Daniel,
Thanks for advising me on right clicking and adding the reference. When I
did that I was able to add the Imports statement. Thanks.
I am still stuck. I have a VB .NET Smart Device project open. I added one
button, and on the click event I added the following code:
Dim mySelectQuery As String = "SELECT OrderID, CustomerID FROM Orders"
Dim myConnection As New SqlConnection("Initial Catalog=Northwind;" & _
"Data Source=COMPUTER-CD9T4F;Integrated Security=SSPI;")
Dim myCommand As New SqlCommand(mySelectQuery, myConnection)
myConnection.Open()
Dim myReader As SqlDataReader
myReader = myCommand.ExecuteReader()
While myReader.Read()
Console.WriteLine((myReader.GetInt32(0) & ", " &
myReader.GetString(1)))
End While
myReader.Close()
myConnection.Close()
I'm pretty sure the connection is good, I wrote a Window Form app and cut
the SqlConnection from that. When I deploy this to the CE emulator in VS
..NET, and when I click the button, I get:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred
in System.Data.SqlClient.dll
Additional information: SqlException
I just can't seem to get this thing right. All I want to do is connect from
a Smart Device app to the SQL server.
Any thoughts?
Thanks,
Steve