sqlcommand question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have a SQLCommand object that has been set with a Stored Proc & the
required parameters. I would like to somehow retrieve the sql text that is
sent to sql server as a result of execution of this command object. Is that
possible? So basically I want to extrapolate the text that ultimately looks
like this:

exec storedproc @param1=0, @param2=1.....

TIA!
 
Param,

This are all properties from your command object, so it is in fact a just
creating a string from those.

Cor
 
There is no mechanism within ADO.NET to fetch the actual command string
that's sent to the server short of using the Profiler.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
 
Back
Top