sda.Update((ds1,table_name1);
is this a immediate line after
dataGridView1.DataSource = ds1.Tables[0];
...???
if yes, it doest make any difference. you are updating the same data back in the table. rather u should make
sda
and
ds1
and private members of class and in any of the events of your choice on gridview or you can call separate menthod which contains these lines based on some condition.
hope this helps..