I have a VB2010 console application that i need to connect to a database and retrieve rows.
i have the following that compiles clean. but the Open command fails for userid.
i have the correct credentials.
Does anyone see what i'm doing wrong?
Dim myConnection As New SqlConnection
Dim myCommand As SqlCommand
myConnection = New SqlConnection("server=NJTAGS00;uid=XXX;pwd=XXXXX;database=[AGS-CLIENT]")
myCommand = New SqlCommand("select RFID,OCRPassageRef,StartOfPassageTime,EndOfPassageTime,Lane FROM [AGS-CLIENT].OCRLane.OCRLane_InGateVehicle Where (OCRLane_InGateVehicle.RFID = '33995655') AND (OCRLane_InGateVehicle.Lane in ('9001','9002')) ORDER BY OCRLane_InGateVehicle.StartOfPassageTime DESC")