I wrote a simple test to check my dataAdapter code. I connect to the SQL Server database, fill a datatable, change a value in a row, and call da.Update(table)
to send the changes back to SQL Server. The table has a primary key. Not at all sure why this isn't working...(see code)
connectionToSQL = new SqlConnection(SQLConnString);
connectionToSQL.Open();
var wktbl = new DataTable();
var cmd = new SqlCommand("SELECT * FROM TAGS$",connectionToSQL);
var da = new SqlDataAdapter(cmd);
var b = new SqlCommandBuilder(da);
da.Fill(wktbl);
wktbl.Rows[3][2] = "5";
wktbl.AcceptChanges();
da.Update(wktbl);
Just skip the call to AcceptChanges and the code should work fine. It marks all rows as unmodified so there's nothing left to do for your Update call.