Solved

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

Posted on 2009-05-11
17
222 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
  • 9
  • 8
17 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
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
Comment Utility
how do I check to see if it is in mixed authentication mode after it has already been installed?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
RTFM: msdn.microsoft.com/en-us/library/ms144284.aspx
0
 

Author Comment

by:VBBRett
Comment Utility
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 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
>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
Comment Utility
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 142

Expert Comment

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

Author Comment

by:VBBRett
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
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
Comment Utility
This is what I found for authentication:

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

Author Comment

by:VBBRett
Comment Utility
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
Comment Utility
So please tell me what I have to do to get this web application running....thanks!
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
0
 

Author Comment

by:VBBRett
Comment Utility
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 142

Expert Comment

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

Author Comment

by:VBBRett
Comment Utility
Did you do Authentication mode = "windows" ?  What did you do to make it work?
0
 
LVL 142

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now