-1

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(); 
             
             }

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by __avd
1

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;   } }

.....
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.