468,140 Members | 1,165 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,140 developers. It's quick & easy.

The user is not associated with a trusted SQL Server

OK, I know this has been a popular question from newbies. But, please
don't haste to reply yet.

I've googled and tested for a few hours, and cannot have this problem
resolved.

I have followed articles on the web and enabled "SQL Server and
Windows Authentication" for my SQL Server 2005. But, it does not
solve my problem. (It is actually my default setting for my SQL
Server)

I have been developing a web application at work just fine. I wanted
to work on it this weekend at home, so I brought everything back and
dumped it onto my home PC running WinXP SP2 and SQL Server 2005.

I am using the same connection string as follows:

"Data Source=localhost;Initial Catalog=MyDatabase; User Id=myusername;
Password=secret;";

The database has been made to be compatible with SQL SERVER 2000.

I've added myusername to the database, and assigned it a dbowner
role.

Well, I can login as myusername using SQL Server Authentication and
view my database tables and do everything else, that means this
credential is fine with the database.

But, my application just cannot connect to this database, no matter
what. The error message says:

Exception Details: System.Data.SqlClient.SqlException: Login failed
for user 'myusername'. The user is not associated with a trusted SQL
Server connection.

Besides not enabling SQL Server Authentication, which is out of the
equation for my case, what else might be causing this problem?

Thank you!

Nov 3 '07 #1
2 2094
Is this an asp.net app? I might be trying to connect using the local
machine's ASPNET account.
Nov 3 '07 #2

"gnewsgroup" <gn********@gmail.comwrote in message
news:11**********************@y42g2000hsy.googlegr oups.com...
OK, I know this has been a popular question from newbies. But, please
don't haste to reply yet.

I've googled and tested for a few hours, and cannot have this problem
resolved.

I have followed articles on the web and enabled "SQL Server and
Windows Authentication" for my SQL Server 2005. But, it does not
solve my problem. (It is actually my default setting for my SQL
Server)

I have been developing a web application at work just fine. I wanted
to work on it this weekend at home, so I brought everything back and
dumped it onto my home PC running WinXP SP2 and SQL Server 2005.

I am using the same connection string as follows:

"Data Source=localhost;Initial Catalog=MyDatabase; User Id=myusername;
Password=secret;";

Where do you use this ConnectionString?

>
The database has been made to be compatible with SQL SERVER 2000.

I've added myusername to the database, and assigned it a dbowner
role.

Well, I can login as myusername using SQL Server Authentication and
view my database tables and do everything else, that means this
credential is fine with the database.

But, my application just cannot connect to this database, no matter
what. The error message says:

What is your application's ConnectionString? I'd bet it is not EXACTLY the
same as the one you showed above, according to the error, is it?

If your application is ASP.NET app and you connect the app to SQL Server via
trusted connection (Windows authetication), then you need to know which user
account is running the application and then make that user account has a
matched SQL Server login and database user (if you do know how to set up SQL
Server login and database user (make a SQL Server login/database use as
dbowner maybe simple, but it would be severe security hole, if the database
is share by many users).

>
Exception Details: System.Data.SqlClient.SqlException: Login failed
for user 'myusername'. The user is not associated with a trusted SQL
Server connection.

Besides not enabling SQL Server Authentication, which is out of the
equation for my case, what else might be causing this problem?

Thank you!
Nov 3 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

27 posts views Thread by didacticone | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.