DataAdapter.Update

  • Thread starter Thread starter A.M-SG
  • Start date Start date
A

A.M-SG

Hi,

I underestand that DataAdapter.Update acts based on RowState to
insert/update/delete records. Is there any possibility that I can see the
scripts that DataAdapter generates and sends them to database? Or can I
possibly monitor the DataAdapter activity? If there isn't any, what would be
the closest way to spy what is going on within DataAdapter?



Thank you,
Alan
 
Hi Alan,

Yes, you can get the actual executing command from the
DataAdapter.RowUpdating event. In the SqlRowUpdatingEventArgs, there is a
member named Command. It's a SqlCommand object that is going to be
executed. Also, the StatementType will tell you what type of the command
is. (SELECT/INSERT/UPDATE/DELETE)

If you're using a SQL server, you can also use a SQL Profiler to achieve
that. HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top