Re: The user is not associated with a trusted SQL Server
- From: "Norman Yuan" <NoAddress@xxxxxxxxxxxx>
- Date: Sat, 3 Nov 2007 08:46:57 -0700
"gnewsgroup" <gnewsgroup@xxxxxxxxx> wrote in message news:1194069738.089534.283650@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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!
.
- References:
- The user is not associated with a trusted SQL Server
- From: gnewsgroup
- The user is not associated with a trusted SQL Server
- Prev by Date: Re: Newbie ASP.NET/Blog question
- Next by Date: Re: AdRotator info
- Previous by thread: Re: The user is not associated with a trusted SQL Server
- Next by thread: Newbie ASP.NET/Blog question
- Index(es):
Relevant Pages
|