Solved

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

Posted on 2009-05-11
17
227 Views
Last Modified: 2012-05-06
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
Comment
Question by:VBBRett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
17 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24357374
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
 

Author Comment

by:VBBRett
ID: 24357396
how do I check to see if it is in mixed authentication mode after it has already been installed?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24357417
RTFM: msdn.microsoft.com/en-us/library/ms144284.aspx
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:VBBRett
ID: 24357457
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
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24357544
>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
 

Author Comment

by:VBBRett
ID: 24357572
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
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24357584
yes. note: you must retart the sql server instance to make the change effective.
0
 

Author Comment

by:VBBRett
ID: 24357761
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
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 24357853
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
 

Author Comment

by:VBBRett
ID: 24357957
This is what I found for authentication:

 <!--Authentication-->
    <authentication mode="Forms">
      <forms loginUrl="Login.aspx"></forms>            
    </authentication>
0
 

Author Comment

by:VBBRett
ID: 24357993
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
 

Author Comment

by:VBBRett
ID: 24358229
So please tell me what I have to do to get this web application running....thanks!
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24358275
0
 

Author Comment

by:VBBRett
ID: 24358520
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
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24358564
I had done it using the above link, so you shall be able to do it also?!
0
 

Author Comment

by:VBBRett
ID: 24359245
Did you do Authentication mode = "windows" ?  What did you do to make it work?
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24359273
on the IIS for your web server, you have to configure the web site to disallow anonymous connections.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question