chandu

chandu

  • NA
  • 10
  • 0

winforms update help??

Mar 10 2010 5:59 AM
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)