this is my coding ..i want return the datarow another form .another form coding i was attached ....please tell me ... replay Quickly...

private void grdClientDetails_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
        {
            //DataTable dt = new DataTable();
            //dsClientDetails.Tables.Add(dt);
             DataRow[] dr;
             dr = dsClientDetails.Tables[0].Select("ACCNUMBER=" + grdClientDetails.ActiveSheet.Cells[e.Row, 1].Text);
             return dr;
            this.Hide();           
        }
        public DataRow[] dr
        {
            get
            {
                return dr;
            }
            set
            {
                dr = value;
            }

        }

another form coding this form only.. 

 frmlookup f1 = new frmlookup("CLIENTDETAILS");
            f1.ShowDialog();
             for ( int i = 0;i< f1.dr.Length; i++)
             {
                txtAccNumber.Text= f1.dr[0][0].ToString(); 
             
             }

Declarare dr (Array of DataRow) outside that method.

DataRow[] dr;

 private void grdClientDetails_CellDoubleClick(object sender, FarPoint.Win.Spread.CellClickEventArgs e)
{
   dr = dsClientDetails.Tables[0].Select("ACCNUMBER=" + grdClientDetails.ActiveSheet.Cells[e.Row, 1].Text);
   this.Hide();           
}
 public DataRow[] dr {  get  {  return dr;   } }

.....
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.