dzconception

dzconception

  • NA
  • 56
  • 8.9k

refresh data problem

Jul 25 2016 9:22 AM
hi
 
ihave this code to select data and display each field in text box
 
 public void showdata()
        {
            
            string reqp = "SELECT * from table";
            cmdp = new FbCommand(reqp, con);
            con.Open();
            drp = cmdp.ExecuteReader();
            DataTable dtp = new DataTable();
            dtp.Load(drp);
            textBox1.Text = dtp.Rows[i][2].ToString();
            textBox2.Text = dtp.Rows[i][3].ToString();
            con.Close();
           
        }
 
i have second form to add data to my table but when i insert new record from form2 i have not a refrsh data
 
i call  showdata() by
Form1 obj = (Form1)Application.OpenForms["Form1"];  in form 2
 
 
 thenks
 
 

Answers (1)