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
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