Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Basic Connection String Question

Status
Not open for further replies.

BoulderBum

Programmer
Jul 11, 2002
2,179
US
I'm totally new to SQL Server, and am simply trying to get connected to one of my databases.

Here's what I have so far:

myConnection = new SqlConnection( "server=localhost;uid=dataReader;pwd=blah;database=CustomWebPrefs");

and this is the error I get:

Login failed for user 'dataReader'. Reason: Not associated with a trusted SQL Server connection.

What might be going wrong? I created dataReader as a user in the CustomWebPrefs db, but I get the same message for any user I try.

As I was writing, I discovered that I can only connect with Windows Authentication in the ODBC Data Source Manager.

Anyone know what's going wrong?

Feel free to keep it really basic. I'm pretty clueless with SQL Server.
 
Tinkering with the Windows Authentication worked after a while, though I don't really understand why I'm having trouble using SQL Server Authentication locally. I'll have to check into that later.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top