private void btn_update_Click(object sender, EventArgs e){
try
{
conStr = @"--------------";
con = new SqlConnection(conStr);
con.Open();
string query = "Select * from tblProduct";
cmd = new SqlCommand(query, con);
sda = new SqlDataAdapter(cmd);
SqlCommandBuilder scb = new SqlCommandBuilder(sda);
sda.Update(tbl);
tbl.AcceptChanges();
con.Close();
MessageBox.Show("Data Updated :) ");
}
catch (Exception ex)
{
MessageBox.Show("error" + ex.Message);
}
}

Sachin SinghRank #66 · 26.2K reputationPosted Jan 26, 2021, 12:13 AM EST
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Jan 26, 2021, 9:10 AM EST
Amit GuptaRank #190 · 12.8K reputationPosted Jan 26, 2021, 10:36 AM EST