1
Answer

refresh data problem

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)

1
Photo of Bhuvanesh Mohankumar
NA 14.4k 1.3m 9y
Please share the code and error you face.
Hope you are trying to insert data from multiple forms by saving each form you move to next form.
If that is the case then better store all data to model and finally submit all and store to database.
Mark as answer, if helpful.
Accepted