4
Reply

Connection string blues (C# -> SQL)

Peter

Peter

Jan 25 2009 2:32 PM
6.4k
I'm learning SQL and how to access it from C#.

This is all on the same machine running XP Pro and .Net 2.0 - I've created a database in SQL Server Express and can manipulate it just fine from the SSMSE console. But when I try to open a connection to it in C# using the SqlConnection.Open() method it say's I'm "Not associated with a trusted SQL Server connection".

I've tried different things in the User Id and Password parameters in the connection string, including my PC login password and not using them at all (hoping it would take the default).

When I start up the SSMSE it lists the "User name" as "GEMINI\peter" (GEMINI is my PC) but if I use that in the connection string it just says GEMINI\peter is not associated with a trusted SQL Server connection.

How do I figure out what it wants? Thanks in advance!

Answers (4)