?
Solved

database cursor

Posted on 2013-10-22
2
Medium Priority
?
206 Views
Last Modified: 2013-10-23
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]")
        myConnection.Open()
        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")
0
Comment
Question by:NJJoeG8GT
[X]
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 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 39592646
You appear to be connecting to SQL server so the connection string syntax would be

myConnection = New SqlConnection("Data Source=NJTAGS00;user id=XXX;password=XXXXX;Initial Catalog=[AGS-CLIENT]")
0
 
LVL 9

Expert Comment

by:sachinpatil10d
ID: 39592798
Just change as below
uid   to user id
Pwd to password
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

649 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