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 fo开发者_如何学编程r example IDs of affected records without a select query after running that update query?
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.
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.
精彩评论