PC Review


Reply
Thread Tools Rate Thread

DataAdapter - View actual sql executed (parameters populated)

 
 
=?Utf-8?B?VFdhaGw=?=
Guest
Posts: n/a
 
      13th Jan 2005
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

 
Reply With Quote
 
 
 
 
Sahil Malik
Guest
Posts: n/a
 
      13th Jan 2005
Yes there is ---

If you're using SQL Server, run the profiler and setup a trace.
else you could see CommandText's but you are left guessing as far as the
"strings properly quoted" Sql Parameters go .. !!

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik


"TWahl" <(E-Mail Removed)> wrote in message
news:52F2B188-E021-420A-9BAA-(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
William \(Bill\) Vaughn
Guest
Posts: n/a
 
      14th Jan 2005
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.
__________________________________

"TWahl" <(E-Mail Removed)> wrote in message
news:52F2B188-E021-420A-9BAA-(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
=?Utf-8?B?dHdhaGw=?=
Guest
Posts: n/a
 
      14th Jan 2005
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


"William (Bill) Vaughn" wrote:

> 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.
> __________________________________
>
> "TWahl" <(E-Mail Removed)> wrote in message
> news:52F2B188-E021-420A-9BAA-(E-Mail Removed)...
> > 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
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataAdapter W/Parameters =?Utf-8?B?SmltSGVhdmV5?= Microsoft ADO .NET 1 21st Nov 2007 12:07 PM
How to know which command executed for DataAdapter.Update(DataSet) Samy Microsoft ASP .NET 0 16th Nov 2005 04:51 AM
Update database using DataAdapter for DataSet populated from XMLfile? NorCan Microsoft ADO .NET 3 3rd Oct 2005 06:56 PM
Re: How to get actual UPDATE SQL statement from DataAdapter brian.takita@gmail.com Microsoft ADO .NET 2 16th Dec 2004 06:47 PM
DataAdapter not being populated using LIKE in select ChrisC Microsoft ADO .NET 0 25th Jul 2003 03:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:31 AM.