odiseh
odiseh

Reputation: 26547

ADO.Net: SqlDataAdapter and get some more info without select query after update method?

I use ADO.net and run an update query by sqldataadapter. The update query updates some records. My question is: Is it possible getting some more info for example IDs of affected records without a select query after running that update query?

Upvotes: 0

Views: 310

Answers (2)

codingbadger
codingbadger

Reputation: 44014

No, not as far as I know.

You would either have to run a select statement after to get the rows affected or if you update using a Data Table then you could get a list of the modified rows.

Upvotes: 1

Sachin Shanbhag
Sachin Shanbhag

Reputation: 55499

Not sure if this works for you. Check this DataTable.GetChanges method.

This is the closest you will get if you are loading datatable and then updating the same. If you are running only update query, then as Barry said, you will have to run select after.

Upvotes: 0

Related Questions