开发者

trusted SQL Server connection

开发者 https://www.devze.com 2022-12-30 23:31 出处:网络
When I attempt to make a connection frommy console app to my sqlExpress. I get the following error: The user is not associated with a trusted SQL Server connection.

When I attempt to make a connection from my console app to my sqlExpress. I get the following error:

The user is not associated with a trusted SQL Server connection.

I have:

      Switched users
      Switched passwords
      Switched Servers
      Switched Databases

I always get the same error. I am using VS 2010 and Sql Server 2005

Here is my current connection string

SqlDatabase sqlDatabase = new SqlDatabase(@"Server=localmachineName\SQLEXPRESS;   database=database1;user id=username; password=mypasswo开发者_Go百科rd;");


Is sql authorization enabled?

Check this if you haven't already: http://www.hosting.com/support/vps/windows/mixedmode/


You're missing a ; between username and password.


As indicated, your connection string does not look correct. You can find examples at connectionstrings.com. Alternatively, this KB article may be of some help.

0

精彩评论

暂无评论...
验证码 换一张
取 消