Showing query for debugging

Results 1 to 2 of 2

Thread: Showing query for debugging

  1. #1
    Join Date
    Dec 1969

    Default Showing query for debugging

    Is their a way to show the final query after or before it is sent for debugging information.<BR><BR>Sub Page_Load<BR> Dim conMyDatabase As SqlConnection<BR> Dim strSelect As String<BR> Dim cmdSelect As SqlCommand<BR><BR> Dim intResult As Integer<BR><BR> conMyDatabase = New SqlConnection( "Server= )<BR> strSelect = "Select name from table where confirmcode=&#039;@confirmcode&#039;"<BR> cmdSelect = New SqlCommand(strSelect, conMyDatabase )<BR> cmdSelect.Parameters.Add( "@confirmcode", Session( "confirmcode2" ) )<BR>print(cmdSelect)<BR> conMyDatabase.Open()<BR> lblName.Text = cmdSelect.ExecuteScalar()<BR> conMyDatabase.Close()<BR>End Sub<BR><BR>I thought it would have been like above but this does not work.<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Showing query for debugging

    Just step-through it.<BR><BR>That way you can view the value of Session("confirmcode2") at runtime, so you will *know* what the statement looks like.<BR><BR>The other way is to just build it as a string and Trace.Write it out.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts