i have to two forms one is customers and second is addcustomers
on customers i have a datagridview on customers load function i select records form database
and populate in datagridview.
but on addcustomers form i want when i press add button after saving recored in database it
updates the datagridview id customers form
because all the customer added no shown in datagridview till i reload the form.
but i want get rid of it. plz help me.
Loading

Anurag SarkarRank #1,049 · 1.8K reputationPosted Aug 20, 2013, 11:39 AM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 20, 2013, 7:39 PM EDT
You need to call Load grid function after updating your customer on button click.
If possible then share your code.
Regards,
Iftikar
ta mu198 reputationPosted Aug 20, 2013, 8:41 PM EDT
i make access modifire public of gridview.
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 20, 2013, 8:47 PM EDT
Regards,
Iftikar
ta mu198 reputationPosted Aug 20, 2013, 9:22 PM EDT
Iftikar HussainRank #423 · 5.9K reputationPosted Aug 20, 2013, 9:25 PM EDT
http://www.dreamincode.net/forums/topic/238727-insert-update-and-delete-records-in-table-with-datagridview-using-c%23/
Regards,
Iftikar
ta mu198 reputationPosted Aug 21, 2013, 7:01 AM EDT
private void button5_Click(object sender, EventArgs e)
{ investor_report re = new investor_report();
re.Show();
DataTable dt = new DataTable(); using (SqlConnection conn = new SqlConnection(@" Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\heaven_prince2009\Desktop\final pr latest\final pr\Database1.mdf;Integrated Security=True;User Instance=True "))
{ if (conn.State == ConnectionState.Closed) conn.Open();
string sql = "select *from add_investor"; SqlCommand cmd = new SqlCommand(sql, conn); SqlDataAdapter dap = new SqlDataAdapter(cmd);
dap.Fill(dt);
if (conn.State == ConnectionState.Open) conn.Close();
conn.Dispose();
re.dtataGridview.dataource=dt; when i try this auto option is data binding. i want to update gridview on form investor_report. while re is its instence
} }