DataAdapter - View actual sql executed (parameters populated)

G

Guest

Hi,
I would like to log the actual sql commands that a dataadapter is executing
against the database. Currently I have been able to use the RowUpdatingEvent
in which I am able to get at the command via eventArgs.Command.CommantText
and the parameters via eventArgs.Command.Parameters but I actually looking
for an easy way to get at the actual SQL with the parameters filled in
(strings properly quoted...). Is there an easy way to achieve this?

Thanks for your help in advance!
Terry
 
W

William \(Bill\) Vaughn

What do you mean by "...strings properly quoted" ?
If you're using a Command object, ADO handles the framing quotes and any
imbedded quotes or other special characters that need worrying about. It
also frames date values for you.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
G

Guest

I am using Oracle and also using a Command object. My goal is that should an
update fail on the DataAdapter I would like throw an exception back to the
caller. Contained in this exception I would like to include the actual SQL
statement that failed.

Thanks in advance,
Terry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top