I am trying to figure out if I need additional logic to avoid a useless call to my SQL db, or if SqlDataAdapter.Update()
will do the right thing. If I have this code:
SqlConnection sqlconn = new SqlConnection(connectionString);
sqlconn.Open();
SqlDataAdapter da = new SqlDataAdapter(selectString, sqlconn);
SqlDataTable table = new SqlDataTable();
da.Fill(table);
new SqlCommandBuilder(da);
table.Rows[0][columnName] = 5; // Existing value is already 5
da.Update(table);
Will .Update()
still call SQL's UPDATE
for that row, or will it not, because no values for the row really changed?