newbie: Console application

S

steve

Hi,
I am trying to follow an example from a book that requires just a simple form with a button.
On the Click event i enter the following code:
---------------------------------------
Dim strConnection As String = "Data Source=Work;" & _

"Initial Catalog=Rafalebd;" & _

"Integrated Security=SSPI;" & _

"Connection Timeout=3"

Dim strSQL As String = "SELECT * FROM tblInfoQA"

Dim sqlConn As New SqlClient.SqlConnection(strConnection)

sqlConn.Open()

Dim myCommand As New SqlClient.SqlCommand(strSQL, sqlConn)

myCommand.CommandType = CommandType.Text

Dim myReader As SqlClient.SqlDataReader = myCommand.ExecuteReader()

Do While myReader.Read

Console.WriteLine("MENVid: " & myReader.GetString(0) & vbTab & "Nom: " & myReader.GetString(6))

Loop

myReader.Close()

sqlConn.Close()

---------------------------------------------

very simple, no errors, but yet i do not see the console!!!!

Of i create a console project and paste the above code inside Sub() then i see the results but very fast since after the loop the console window closes.

What am I doing wrong? Is there a way to access a console through a regular (GUI) Vb.net project ?

TIA

steve
 
L

Larry Serflaten

Console.WriteLine("MENVid: " & myReader.GetString(0) & vbTab & "Nom: " & myReader.GetString(6))

very simple, no errors, but yet i do not see the console!!!!


On the IDE menu, select: View > Other Windows > Output


LFS
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top