开发者

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

开发者 https://www.devze.com 2023-01-16 22:11 出处:网络
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 recor

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消