Printing out sql query on screen

Posted on 2006-11-01
Last Modified: 2011-04-14
I would like to be able to see my sql querys on screen (or in any other way) when debugging.

In classing asp I could just print out the query with it's values like

sql = "Select * from table where id = " & request("id")
set rs = conn.execute(sql)

then I could see what values where in the query.

How can I get a similar result in
Question by:peternordberg
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
LVL 14

Expert Comment

ID: 17850385
   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim sql As String
        Sql = "Select * from table where id = " & Request("id")
    End Sub
LVL 96

Expert Comment

by:Bob Learned
ID: 17851593
You can also use System.Diagnostics.Debug.WriteLine to set it in the Output window.


Author Comment

ID: 17852204
How do I do that?
LVL 96

Accepted Solution

Bob Learned earned 250 total points
ID: 17854902
Dim commandText As String = "Select * From Users Where Name = 'Bob' "


Author Comment

ID: 17856188
ok, I'll try

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question ( here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question