SqlDataSource and actual sql text going to db

  • Thread starter Thread starter probashi
  • Start date Start date
P

probashi

Hi,

I have a SqlDataSource and there are 3 select parameters. I am using
this data source for a Grid View Control.

For my debugging purpose I would like to see the actual sql text going
to database (after evaluating all select parameters). I added a text
box to display the actual SQL text using the following, but it is
showing the parameters not the evaluated sql.

protected void SqlDataSource1_Selecting(object sender,
SqlDataSourceSelectingEventArgs e)
{
txtLog.Text += SqlDataSource1.SelectCommand;
}

I could run a SQL Profiler to find out the actual SQL text but I am
using Qracle 9i (I do not know who to set up a Profiler in Oracle)

Thanks
 
Parameters are processed by the database driver. I don't think you can see
the actual sql at any point prior the driver gets the statement.
 
This is easy--just turn on the SQL Server Profiler--it's included with all
of the versions except SQL Server Express. The Profiler can show every
conversation with the SQL Server in intimate (too much) detail. Be sure to
set filters to show just what you need.

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
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.
__________________________________
 
Sorry, I read too fast. The Profiler does not work with Oracle. However, it
seems to me that there is a new Trace feature added to VS 2005.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
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.
__________________________________
 
Back
Top