Re: The user is not associated with a trusted SQL Server

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"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!


.



Relevant Pages

  • Idiomatic Expressions to Operating System Architecture: Transforming Rigids
    ... <Subject: Re: Idiomatic Expressions to Operating ... <endpoint during a single session * DATABASE + by ... <statements is a new feature of SQL Server 2005. ...
    (sci.math)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Hitchhiker's Guide to Visual Studio and SQL Server ... Create a Connection object and pass in a ConnectionString to ... manage the database table you reference. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: (Newbie)Application Roles
    ... level: the database itself. ... SQL Server accommodates these needs through the use of application ... the user's connection through a specific application. ... the connection permanently loses all permissions applied to ...
    (microsoft.public.sqlserver.security)
  • Re: Help! Set up Windows Group to access application
    ... The connection string for a trusted connection is: ... --add login as database user ... SQL Server MVP ... If you have troubles with finding your ways in Crystal Reports, ...
    (microsoft.public.sqlserver.security)
  • Re: My Book is Incomplete Regarding SQL Commands ;-(
    ... Visual Studio but not to VS 2003. ... Create a Connection object and pass in a ConnectionString to address ... manage the database table you reference. ... Yep, my latest book can help too, but mostly if you're targeting SQL Server ...
    (microsoft.public.dotnet.framework.adonet)