outputting sql

Nate

New Member
Hi,<BR><BR>Is there any way of outputting the sql command like I used to in classic asp (response.write(SQL) - where SQL is the SQL command variable)? Or use some sort of SQL debug facility?<BR><BR>Here is my .NET code<BR><BR>con = New SqlConnection "Server=sqlserver;UID=me;PWD=pwd;Database=db")<BR>SQL = New SqlCommand("SELECT * FROM table WHERE id = @id", con)<BR>SQL.Parameters.Add("@id", 3)<BR>con.Open()<BR>datareader = SQL.ExecuteReader()<BR><BR>I would like the response.write output to be: SELECT * FROM table WHERE id = 3<BR><BR>Anyone?<BR><BR>Cheers<BR><BR>Dave <BR>try: response.write(SQL.commandText)
 
Back
Top