Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. #5

 I'm having a hard time fixing a login.aspx page that was actually working a couple of days ago.

I have SQL Server 2008 Express installed on the web server and have created an ASPNETDB.MDF file in the App_Data folder of my website. 

The server is Windows Server 2003 R2 with SP 2. 

On my Login.aspx page I have a <asp:login> control.

I was getting this error when I tried to log in:

Login failed for user 'NT AUTHORITY\NETWORK SERVICE'

Someone suggested that I hard code a username and password in my connection string and now I get this:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.

I'm using Forms Authentication and have identity impersonate="true" in my web.config.

Right now this is what I have in my connection string, I know it's not right:

<add name="LocalSqlServer" connectionString="Server=.\SQLExpress; AttachDbFilename=|DataDirectory|ASPNETDB.MDF;User ID=domain\username;Password=Pass@word1;Trusted_Connection=Yes; User Instance=false" providerName="System.Data.SqlClient" />

Any help with this would be greatly appreciated.  I've very little experience with this.

0
megnin
1/4/2009 12:22:00 AM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

3 Replies
808 Views

Similar Articles

[PageSpeed] 47

Here is what I have in my we.config for local tests

<!--add name="Conn" connectionString="Server=SERVERNAME\MSSMLBIZ; Database=FCCMS; uid=userID; pwd=password"/-->

<!-- Local config -->

<add name="Conn" connectionString="Server=SERVERNAME\MSSMLBIZ; Database=FCCMS;Integrated Security=True"/>

<!--add name="FCCMSConnectionString" connectionString="Data Source=SERVERNAME\MSSMLBIZ;Initial Catalog=FCCMS;Persist Security Info=True;User ID=userid;Password=password;Max Pool Size=1000;Asynchronous Processing=true;" providerName="System.Data.SqlClient"/-->

<add name="FCCMSConnectionString" connectionString="Data Source=SERVERNAME\MSSMLBIZ;Initial Catalog=FCCMS;Integrated Security=True;Max Pool Size=1000;Asynchronous Processing=true" providerName="System.Data.SqlClient"/>

</connectionStrings>

<appSettings>

<add key="Conn" value="Server=SERVERNAME\MSSMLBIZ; Database=FCCMS;;Integrated Security=True;Asynchronous Processing=true;"/>

<add key="devEmail" value="my email"/>

<add key="Debug" value="n"/>

</appSettings>

 

 


Beware of bugs in the above code; I have only proved it correct, not tried it.
(Donald Knuth)
0
Naom
1/4/2009 2:03:48 AM

Hi,megnin

U require Grant Access To 'NT AUTHORITY\NETWORK SERVICE' to ur database

 Try These

Use MyDatabase

Grant Execute to [NT AUTHORITY\NETWORK SERVICE]

grant exec on schema::dbo to [NT AUTHORITY\NETWORK SERVICE]

 

 

Furhter U can refer These

http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/Q_23126838.html
http://social.msdn.microsoft.com/forums/en-US/sqlsecurity/thread/9960cce7-bf46-45d2-918c-808500a5c246/
http://forums.asp.net/p/1151083/1877249.aspx#1877249 

 

Or google out

http://www.google.co.in/search?hl=en&q=Login+failed+for+user++Reason%3A+Not+associated+with+a+trusted+SQL+Server+connection.&btnG=Search&meta=


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


0
raghav_khunger
1/4/2009 5:49:48 AM

Thank you for the suggestions.

I've since managed to totally screw up my SQL Server so that I can't even log in to it with Management Studio locally with any login.  I can't change the "Log On As" in the Manager either due to a "Log on failure".  I think the only thing I can do now is uninstall SQL Server.

The site has to go live tomorrow, so it will just go live with no log in. :-(

0
megnin
1/4/2009 10:17:50 PM
Reply:

Similar Artilces:

[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Hello All, I'm Getting the following error when calling a dll from my vb.net application. [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. The dll was written in vb6 and accesses a sql db using the following connection string. Public Const GLOBAL_DNS As String = "DSN=TransSrvFinal;UID=sa;PWD=admin;" This DLL works fine when called from other Windows Apps. However I'm now trying to call this dll from with in an asp.net application. I'm using vb.net as the codebehind. I'm a...

2008 IIS7 connection to SQL Server 2000 on Web Server 2000: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
I am setting up a windows 2008 IIS7 web server, and trying to connect to a windows 2000 sql server 2000 database. I have an IIS6 Windows 2000 web server activately connected just fine. I have anonymous and windows authentication enabled. And in my web.config I have identity impersonate="true" My sql server 2000 typically uses the IISUSER anonymous user set up in IIS6 on my original windows 2000 web server. But this new IIS7 is giving me grief. I can't seem to setup the IUSR or IISUSER or anything in it. I can't even use sql server credentials in my connection string altho...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
Hi i installed msde with follwoing attributes for a project DotnetNUke..C:\sql2ksp3\MSDE\>Setup.exe SAPWD="password "INSTANCENAME="DNNV3" SECURITYMODE=SQLin my web.config file here is what i am using==><appSettings>    <add key="SiteSqlServer" value="Server=(local);Database=DNNV3;uid=;pwd=password;" />   but i am getting below error...can anyone PLEASE help me on this.thanks a lotInstalling DotNetNukeUpgrade Error: ERROR: Could not connect to database specified in connectionString for SqlDataProvider   ---------------------------------------------...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
 Hmmm.... I have been developing a site on my local machine and it all works there. When I push it to the web-server it does not. I have used connection strings in my web.config file that look like this (the names have been changed to protect the innocent.. or me...) <add name="TDemoSiteConnectionString" connectionString="Data Source=192.168.8.37;Initial Catalog=TDemoSite;Persist Security Info=True;User ID=TDemo;Password=fred" providerName="System.Data.SqlClient" /> When I call a table adapter I get the error 'login failed for user null'. W...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Came in this morning and im getting the following error in our Provisioning tool. This was working as of yesterday and no changes were made to the web.config file. Ive failed over the cluster on the sql servers and also restarted the provisioning engine. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. The SQL server is setup for mixed mode authentication and ive opened my web.config file with visual studio and can make a connection with the same sql user and pass thats in my web.config to the proper databases.  The provisioning se...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
After sucessful installation of portal Starter kit, Portal Database was created and portaluser was the new login created. but when i tried to access the portalVBSDK on my PC this error is displayed. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: Login failed for user '(null)'. Rea...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
I dont believe that no one can help me in this damn error,Please, I'm gonne lose my job offer If I didnt fix this. I have spent 7 days searching with no use !! I use ASP.NET 2.0 with C# to develop an intranet site, it was working perfectly when i was on Visual Studio, when i tried to publish the site it gave me that error. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. the web application on IIS server, windows 2003 - the database on a different server windows 2003, sql server 2000. Regaeding that we have proxy server, one fi...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Can anyone tell me why I get this error message and how to fix it? Thanks, Scott I would guess that it is because your SQL server is set up for windows authentication rather than mixed mode, and that your ASPNET account doesn't have a corresponding SQL server account. Jeff MartinMCSD C# .NEThttp://www.jeffmartin.com I found this method of changing modes on another site, and it helped me a lot. You can change the authentication to "SQL Server and Windows" by changing this registry setting: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer\MSSQLServer LoginMode = ...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
Dear All,I am trying to establish a connection to my SQL Server which is on the Remote machine. My ASP.Net application is on the local machine. Below is my connection string: <appSettings><add key="NorthConn" value="server=ABC;integrated security=sspi;database=Northwind"/></appSettings>The North wind Database has the following user accounts:1) ABC\ASPNET2)ABC\IUSR_ABCboth of these accounts have permissions granted to them.My SQL Server has both Windows and SQL Server authentication checked. I checked the properties of my  web project in IIS  and it has both Anony...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Hello, I have installed DotNetNuke on my computer and did everything they said in the Configuration. But when I want to start http://localhost/DotNetNuke I receive an error: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. What is this. There is a Datavbase called DotNetNuke in SQL-Server gr. miles You have to have a user assigned to the database and use those credentials in you connection string (web.config)...~ChrisNet Data Design706Horsman.us This is a sql/msde authentication issue. Your web.config is using windows authent...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
hi all. This is my first web form,and I am trying to conenct to a table in Ms SQL Server. when I run my program I got the followin error message: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. I am using windows 2000 authentication. How can I fix it ? Thanks jsn hello, u need to privde a username and password for the SQL server that you are using !!!Bilal Hadiar, MCP, MCTS, MCPD, MCTMicrosoft MVP - Telerik MVP 1. Open IIS, right-click on the virtual directory for your site and click on Properties. 2. Click the Dire...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
This code is giving me this error using System; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Text;     namespace WebApplication1 { /// <summary> /// Summary description for WebForm1. /// </summary> public class WebForm1 : System.Web.UI.Page { private void Page_Load(object sender, System.EventArgs e) { SqlConnection con; string sql; SqlDataAdapter adExisting; //con = new SqlConnection("Data Source=slon12d11012";User ID=nnichol1;); //con = new SqlConnection("Initial Catalog=DACari;Data Source=slon12d1101...

Erro : Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
Hi, I am built-in web server feature of VS 2005 to run my web application as I dont IIS is intstalled on my desktop computer. from this page , application is connecting to SQL server 2000 installed on Windows 2003 Server  on a remote machine. Here is connectionStr = "Data Source=myservername; Integrated Security=True; Trusted_Connection=yes;Initial Catalog=myDB" Application is generating foloowing error message when try to open the connection SQLServer.Open() method. "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection" Any help in thi...

Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection #2
I realize people have had this problem before. Probably on this very board. But I am up against a wall and none of the solutions I have found online work at all. I have a asp.net 1.x application that sits on an IIS server and talks to an SQL 2000 database on a separate server. It was working fine until about a week ago when all of the sudden I started recieving the following error: "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection" In IIS manager the application is set up in a virtual directory, denies anonymous users, and uses only Integrat...

Web resources about - Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. #5 - asp.net.sql-datasource


Trai rules in favour of net neutrality
Telecom regulator says no service provider can offer, charge discriminatory tariffs for data services on basis of content

Slack, Honor, Gear VR, Stewart Butterfield, Bill Gurley win at the 9th Annual Crunchies
TechCrunch : Slack, Honor, Gear VR, Stewart Butterfield, Bill Gurley win at the 9th Annual Crunchies — And The Winners Of The 9th Annual Crunchies ...

Hackers publish data on thousands of DHS and FBI workers
Following the publication of data belonging to about 10,000 Department of Homeland Security workers, hackers have now published the contact info ...

Hong Kong Sees Violent Start to Chinese New Year as Protesters Clash With Police
TIME Hong Kong Sees Violent Start to Chinese New Year as Protesters Clash With Police TIME Violence erupted in Hong Kong Monday night after ...

Is it time to give up on WordPress sites?
It’s being reported by Malwarebytes’ CyberheistNews and other sources that a unexpectedly large wave of hacking has been hitting thousands of ...

Judge again denies Texas' efforts to block Syrian refugees
Dallas Morning News Judge again denies Texas' efforts to block Syrian refugees Post-Bulletin AUSTIN, Texas (AP) — A federal judge Monday again ...

Cruise Ship Does A 180 After Getting Wrecked By Huge Storm
Over 4,500 passengers and 1,600 crew members were on their way from New York to Florida and the Bahamas when their ship got tossed around like ...

It’s official: Instagram for iOS now supports multiple account switching
Instagram has officially announced that it has begun rolling out support for switching between multiple accounts in its iOS app, without requiring ...

Elton John doesn’t own a cell phone
The admission shocked "Late Late Show" host James Corden.

Resources last updated: 2/9/2016 7:03:00 AM