Getting error "Login failed for user ''. The user is not associated with a trusted SQL Server connection" on trying to authenticate a user

Hi,

I created aspnetdb on Sql Server 2005 and modified my web.config LocalSqlServer connection string to connect to the Sql Server instead of mdf file on Sql Server. When i click Log In button on my login control i am getting the error "Login failed for user ''. The user is not associated with a trusted SQL Server connection"

But when i bind a radio button list or any control to select from aspnet_users or roles table data is displayed fine without any login errors (i am using aspnetdbConnectionString given below for binding data). Why is it happening only when i authenticate but not when i query to display without authenticating?

Please note that IIS and Sql Server are on different machines.This is how my web.config looks:

<

connectionStrings>

<

remove name="LocalSqlServer" />

<

add name="LocalSqlServer" connectionString="Data Source=MyServer;Initial Catalog=aspnetdb;Integrated Security=True"

providerName="System.Data.SqlClient" />

<add name="aspnetdbConnectionString" connectionString="Data Source=MyServer;Initial Catalog=aspnetdb;Integrated Security=True"

providerName="System.Data.SqlClient" />

</

connectionStrings>

<

system.web>

<identity impersonate="true" />

<

roleManager enabled="true" />

<

authentication mode="Forms" />

</system.web>

Thanks,

Sravanthi.

 

0
sravanthi
7/14/2006 3:29:25 PM
asp.net.security 27051 articles. 1 followers. Follow

4 Replies
1866 Views

Similar Articles

[PageSpeed] 43

Did you run the aspnet_regsql command on your Sql 2005 server to create the membership table, scripts and users in your new database?
Bryan Sampica
Auction Site StarterKit |
My Blog
0
Freakyuno
7/14/2006 3:53:47 PM
Yes I used aspnet_regsql to create the aspnetdb in Sql Server.
0
sravanthi
7/15/2006 6:12:24 AM

It's highly possible, and probable that this is a permissions issue.  When you do a "query" from the database, your using read access permissions, which are typically a lot looser than write access permissions, which occur when you try to log in. 

Make sure the folder your DB is in, has Read / Write permissions for either the NETWORK SERVICE account or the ASP.NET account, depending on which version of windows your running.

 


Bryan Sampica
Auction Site StarterKit |
My Blog
0
Freakyuno
7/15/2006 1:07:16 PM
has anyone found a fix for this yet?

I don't think this has to do with read/write permissions on the DB folder.
0
photoz
7/28/2006 3:43:08 PM
Reply:

Similar Artilces:

error "Login failed for user ''. The user is not associated with a trusted SQL Server connection. "
All the research I found dealing with this problem is that the solution is to set SQLserver to mix mode.  I have SQL server already set to mix mode. I am not sure what else to do. Has anybody run into this problem? my connection string: <connectionStrings> <add name="ConnectionString" connectionString="Data Source= server name ; Initial Catalog=FILESHAREDB.MDF; Integrated Security=false;"providerName="System.Data.SqlClient"/> </connectionStrings>   Server Error in '/SendItNow' Application.  ...

How to Handle Error Message: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
I'm running WinXP and using "Visual Studio 2005". To make a long story short, my "Default.aspx" page is using a GridView to display data which is being read from a Windows 2000 DB server. When I run the app under the IDE all works fine. I copied the 1 file and put it into my folder as, "C:\Inetpub\wwwroot\default.aspx". When it loads I receive the error message, "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection." I'm frustrated with Studio Express 05 and will not bother with it again until Microsoft fixes this deployment issue. Can any one ...

You may receive the error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection"
Hi,Choosing integrated authentication for ASP.NET applications is a good choice because no credentials are ever stored within your connection string for your application. However, you may receive the error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection" while trying to use Integrated Windows Authentication and your application needs to access the SQL Server Database using Trusted Connection.I have explained the resolution in the following articlehttp://harishmvp.blogspot.com/2005/05/you-may-receive-error-login-failed-for.htmlThanks.regards,Harish...

You may receive the error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection"
This article is in continuation with Part I where I explained the scenarios where this error occurs when the Webserver and SQL Server are running on the same machine.It explains the scenario where you have your Webserver and SQL Server running on different machines.  http://harishmvp.blogspot.com/2005/05/you-may-receive-error-login-failed-for_25.htmlThanks.regards,Harishhttp://geekswithblogs.net/ranganh...

"Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection"
Hi all,newbie here so please bear with me.I'm on a shared hosting account and I have set up a database but when I try to login I keep getting this error:"Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection"I've looked about for a solution but it all seems to be about altering IIS settings or creating a domain account, as I'm on shared hosting I can't do either of these. What should I be doing? Thanks for any help.     Hi,tirelessU can Go for these In web.config<system.web> <identi...

In debug mode I get Login failed for user ''. The user is not associated with a trusted SQL Server connection.
The error msg only appears when I try and debug. When using the site normally there is no problem?? Hello,     The reference below is the solution of your problem.     The user is not associated with a trusted SQL Server connectionPlease give us feedback no matter whether you get your answer.Please "mark as answer" if it's useful for youSincerely,Jerome...

Login failed for user 'Bachelorplace'. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)
please tellme how to resolve this error, i m using server studio management tool. and trying to connect using sql server authentication. my pc is over a domain.   Login failed for user 'Bachelorplace'. The user is not associated with a trusted SQL Server connection. (.Net SqlClient Data Provider)  check whether that sql server is allowing sqlauthentication or not.select that server -> right click it-> select  properties  -> in the window, select security -> check what is the server authentication. it should be  sqlserver and windows authentica...

Login failed for user ''. The user is not associated with a trusted SQL Server connection.?
Hello, I just got a copy of a website I was supposed to be working on.  I went to the web.config file changed the machine name to my machine's name and when I try to run the program I get the following error.  Could someone give me some advice on how to fix this ?  Thanks! On your production site, the site passes the web user's credentials (your IUSER account) to your sql server.   Make sure that your local site is set up to pass your credentials along to the sql server.  In your web.config, add identity impersonate=true. --JJPlease mark ...

Login failed for user ''. The user is not associated with a trusted SQL Server connection.
I have a windows 2003 server hosting MS SQL  Server 2005. Another windows 2003 server hosting my App, and clients from the local intranet and outside (web). How do I surpass this problem, when it all works fine locally on my development machine? Use Forms authentication! AlCheersAlMy BlogMapStats.NETPlease click on 'Mark as Answer' if this post answered your question! I am using Forms authentication. <connectionStrings> <add name="memSocConnection" connectionString=" Data Source=WSPASQL01; Initial Catalog=mem_soc;Integrated Security=True" providerName="Syste...

Login failed for user ''. The user is not associated with a trusted SQL Server connection.
Hello everyone, I have a local IIS (WinXP) and a remote SQL Server 2005 DB.  When I try to run login using the aspnetdb, I get the following error: Login failed for user ''. The user is not associated with a trusted SQL Server connection. When I run the form in debug mode from Visual Web Developer 2005 Express it works fine.  In other words when the VWD launches the web page as http://localhost:1234 it works, but when I run the same page from http://localhost I get the error. I know this is permission issues.  I did a search and found info to add the ASPNET user t...

Login failed for user ''. The user is not associated with a trusted SQL Server connection
 Hi to all......... In my project I am using windows authentication and if I am running through the IIS getting this error. Suppose if I am directly run the project or use server authentication then I wont get this error.My web.config file is <?xml version="1.0"?><configuration>  <configSections>    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">  ...

Login failed for user ''. The user is not associated with a trusted SQL Server connection. #3
Hi I'm making a website and will upload it next via ftp but i need to access the local server for database retrieval from this website. i'm doing so first time so not sure about its working and isues. Through google search and from forums i collect some info to work on it. now i have made a connection string to access remotely that gives the following error when i make the connection open  "Login failed for user ''. The user is not associated with a trusted SQL Server connection." the local server use the windows authentication mode or may be the mix mode. ...

Login failed for user 'maritos'. The user is not associated with a trusted SQL Server connection.
  How can i solve this issue? Thank youMario Lopes Hi,mariolopes  Where r u getting this message Plz Specify ur  Problem in detail.              RAGHAV MVP ASP/ASP.Net Read My Blog MARK THE POST AS ANSWER IF IT HELPS U. "Success doesn't come to you…you go to it."--Marva Collins "Success does not come to those who wait . . . and it does not wait for anyone to come to it." Anonymous  See if the below KB helps.http://support.microsoft.com/kb/555332 Thanks,Dhimant Trivedi"When the going gets t...

Login failed for user ''. The user is not associated with a trusted SQL Server connection. #2
I've seen many, many, many, many posts regarding this topic - but none have been able to fully explain nor fix my problem.I've developed a security solution according to Scott Gu's guide and it works great - but only on my local machine running VWD and SQLExp2005. Once I move this application it completely breaks in the productions environment.  Today I managed to get it halfway there. I created a SQL login and changed my web.config to use these credentials - now the web application will come up, but none of my links (that are role based) are displayed - most likely because ...

Web resources about - Getting error "Login failed for user ''. The user is not associated with a trusted SQL Server connection" on trying to authenticate a user - asp.net.security

Resources last updated: 11/30/2015 2:36:45 PM