views:

147

answers:

1

Does Ado.net check if the following update is required?

ADDRESS table with a TOWN column, for example.

Retrieve a ADDRESS row that has a TOWN value of "Leeds"

In update code ADDRESS.TOWN gets set to "Leeds" , i.e. Its not actually changed.

We have called Set methods or assignments so RowState gets changed to modified.

Does the adapter pass the non change to the database or is the framework clever enough to work out that it doesn't need to?

If it does, does this effect the DBs transaction log?

Am I worrying too much?

A: 

When I tested this, it did call an update on the database.

To reiterate, I loaded a typed DataTable and retrieved a typed DataRow, set a property to the same value, then called the typed TableAdapter's Update method on the typed DataRow. I saw in SQL Server Profiler where an update was being sent even though it logically didn't need to be.

Derek Morrison

related questions