I use SqlDataAdapter
and SqlCommandBuilder
to perform DML transactions on rows in a SQL Server database.
I am able to add and delete multiple rows in database but update.
This is the code:
SqlDataAdapter da = new SqlDataAdapter(@"select top 1 * from " + tableName,
ConnectionString);
SqlCommandBuilder cmdBuilder = new SqlCommandBuilder(da);
da.Update(dt);
I'm trying to use AcceptChanges
, so far it doesn't work.
i have found reason, a column is set DateTime type. So, this Column isn't saving to the database.