7
Answers

winforms update help??

chandu

chandu

14y
2.2k
1
hi all i have created a datagridview to display my records from db,and now i want to update the records below shown is my code
 
SqlDataAdapter
da = new SqlDataAdapter("select * from emp", con);
SqlCommandBuilder
cb = new SqlCommandBuilder(da);
DataSet
ds = new DataSet();

dataGridView1.DataSource = ds.Tables[0];
da.UpdateCommand = cb.GetUpdateCommand();
da.Update(ds);
but when i execute the code and update the values they are not getting updated in my database??i dnt know y?? plz help me with this,thanks.
Answers (7)