Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 237
  • Last Modified:

Login failed for user 'SQLUser'. The user is not associated with a trusted SQL Server connection.

I tried to create a profile in a asp.net page in an ASP.NET application I am developing.  For some reason, I get the error that states: Login failed for user 'SQLUser'. The user is not associated with a trusted SQL Server connection.  Whenever I try to create a userid/password for a website I am developing, I get that error.  What do I have to do to get rid of the error?
0
VBBRett
Asked:
VBBRett
  • 9
  • 8
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you must first check that the sql server instance you connect to is in mixed authentication mode, to allow sql logins.
in the default "windows authentication only", it only allows windows-based logins to connect.
0
 
VBBRettAuthor Commented:
how do I check to see if it is in mixed authentication mode after it has already been installed?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
RTFM: msdn.microsoft.com/en-us/library/ms144284.aspx
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
VBBRettAuthor Commented:
How do I set the database to be mixed authentication?  I tried to set myself as the user to login and when I create a user with a userid and password... I get no dice.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
>How do I set the database to be mixed authentication?
it's not per database, but per sql server instance.

did you read that link, actually?
0
 
VBBRettAuthor Commented:
Yes, I saw that I could set it as mixed authentication mode.  Is this is what is stopping me from moving forward on my project?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
yes. note: you must retart the sql server instance to make the change effective.
0
 
VBBRettAuthor Commented:
Is it the connection string?  Here is what I have so far:

<!--Connection String-->
  <connectionStrings>
    <add name="EmpScreeningConnStr" connectionString="Data Source=(local);Initial Catalog=EmpScreening;User ID=bsmith9;Password=password"
      providerName="System.Data.SqlClient" />
  </connectionStrings>
  <appSettings />
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
that seems fine, IF the authentication mode is set to mixed, AND if you created that login (bsmith9) in your sql server's security->logins, AND if you mapped that login to a user in the database EmpScreening (and you also need to grant permissions/roles to that user...)
0
 
VBBRettAuthor Commented:
This is what I found for authentication:

 <!--Authentication-->
    <authentication mode="Forms">
      <forms loginUrl="Login.aspx"></forms>            
    </authentication>
0
 
VBBRettAuthor Commented:
Whoa, how do I do all of that?  I have this for authentication:
<!--Authentication-->
    <authentication mode="Forms">
      <forms loginUrl="Login.aspx"></forms>            
    </authentication>

How do I set it to mixed mode?
0
 
VBBRettAuthor Commented:
So please tell me what I have to do to get this web application running....thanks!
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
0
 
VBBRettAuthor Commented:
I'm a little bit lost and I am wondering why I keep on getting the

Login failed for user 'SQLUser'. The user is not associated with a trusted SQL Server connection. error.  What is the solution for this?  I took this from another developer's computer and it seemed to work fine on his computer, fast forward to now, and I am unable to get it to work on my computer.  This is very frustrating actually and I am trying every different option I can think of.  Do I have to adjust the web.config..that is where the user info is beinig rejected.
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
I had done it using the above link, so you shall be able to do it also?!
0
 
VBBRettAuthor Commented:
Did you do Authentication mode = "windows" ?  What did you do to make it work?
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
on the IIS for your web server, you have to configure the web site to disallow anonymous connections.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 9
  • 8
Tackle projects and never again get stuck behind a technical roadblock.
Join Now