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

Hi I have am developing on xp machine with iis 5.1 and trying to connect to a seperate windows 2003 machine with mssql 2000 installed.

I would like to use a trusted connection and I added an asp account on the sql server with permissions to the database and also edited the security tab on IIS to have this account. I unchecked allow IIS to control this password. 

 When I look in the event viewer on my local machine I get an error:

Process information:
    Process ID: 2388
    Process name: aspnet_wp.exe
    Account name: MACHINENAME\ASPNET
 
Exception information:
    Exception type: SqlException
    Exception message: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. 

 

 Any Ideas as to how I can fix this?


 

0
digitalbart
1/18/2007 6:34:15 PM
asp.net.sql-datasource 29906 articles. 0 followers. Follow

7 Replies
826 Views

Similar Articles

[PageSpeed] 30

You need to change SQL Server Authentication to mixed mode that is both Window and SQL Server also check the permissions for the Asp.net account and all is covered below.  Post again if you still have question.  Hope this helps

http://geekswithblogs.net/ranganh/archive/2005/05/25/40503.aspx


Kind regards,
Gift Peddie
0
Caddre
1/18/2007 10:08:30 PM

Hi,

Could you provide connection string which you use to connect to SQL server.

Are you sure that you XPBox\aspnet user has rights on SERVER? maybe you need impersonation to use windows authentication or use SQL authentication

Thanks

JPazgier


Thanks

JPazgier
0
jpazgier
1/18/2007 11:45:36 PM

I tried impersonation, but it did not work it always kept showing my xpmachine/aspnet user in the event viewer as a "Null" user.

  Below is my webconfig file

1    
2    <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
3    
4    
5      <connectionStrings>
6        <remove name="LocalSqlServer" />
7        <add name="LocalSqlServer" connectionString="server=lssql01; database=web; Trusted_Connection=true" />
8      </connectionStrings>
9    
10     <system.web>
11       <!-- Settings that remove some password rules. -->
12       <!--
13       <membership defaultProvider="MyMembershipProvider">
14       <providers>
15         <clear/>
16         <add 
17           name="MyMembershipProvider" 
18           type="System.Web.Security.SqlMembershipProvider" 
19           connectionStringName="LocalSqlServer"
20           requiresQuestionAndAnswer="false"
21           minRequiredPasswordLength="1"
22           minRequiredNonalphanumericCharacters="0" />
23       </providers>
24       </membership>-->
25       <customErrors mode="RemoteOnly" />
26       <authentication mode="Forms" />
27       <compilation debug="true"/>
28   
29       <membership defaultProvider="MyMembershipProvider">
30         <providers>
31           <clear/>
32           <add
33             name="MyMembershipProvider"
34             type="System.Web.Security.SqlMembershipProvider"
35             connectionStringName="LocalSqlServer"
36             requiresQuestionAndAnswer="false"
37             minRequiredPasswordLength="1"
38             minRequiredNonalphanumericCharacters="0" />
39         </providers>
40       </membership>
41       <identity impersonate="true" />
42     </system.web>
43     
44   </configuration>
45   
 

 

0
digitalbart
1/19/2007 3:51:17 PM
digitalbart:

I tried impersonation, but it did not work it always kept showing my xpmachine/aspnet user in the event viewer as a "Null" user.

 

Null user is not related to impersonation because before you can impersonate for your users Asp.net needs access to SQL Server and the relevant database, that is Null user meaning Asp.net does not exist in SQL Server or your database so either change to mixed mode as I tell you or give an existing Windows account access to SQL Server and the database for integrated security.  Hope this helps.


Kind regards,
Gift Peddie
0
Caddre
1/19/2007 4:36:06 PM
Sorry I forgot to tell you, I am using mixed mode but the account is a local machine account and I can't give that access to my SQL server because it is on a remote machine. I tried creating a domain account and then giving it access to the database and also ASP rights on my machine and it still gave me the same error.
0
digitalbart
1/19/2007 5:44:37 PM

Yes your situation is special because you need to give Asp.net account in IIS 5 access to Windows 2003 and then create two permissions in SQL Server for that account something similar to the thread below.  Hope this helps.

http://forums.asp.net/thread/1530805.aspx


Kind regards,
Gift Peddie
0
Caddre
1/19/2007 6:05:35 PM

Based on your connection string in your web page you use windows authentication to connect to SQL server. So to do this you have to create domain user domain.ASPnet on you SQL server and run IIS service as this domain user on your second box. Or if you already use mixed mode on SQL server just modify your connection string to use SQL authentication.

I hope that it will help you a little.

By the way why you run IIS on XP box it has limit for incoming web clients?

Thanks

 


Thanks

JPazgier
0
jpazgier
1/21/2007 3:57:05 AM
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. #3
hi,  there are two win2003 servers in the same workgroup. one has mssql 2000 server and other one has asp.net 2.0 web application connecting that mssql server. mssql server Authentication is SQL Server and Windows but when i try to connect using sql authentication with uid and pwd, i get the error; Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. searched a lot about it but couldnt find any solutions. the win2003 server which hosts mssql server has active directory. is this could be the problem? thanks in advance.  amete...

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
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.
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.
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.
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.
 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.
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...

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. #2
Basic setup IIS 6 with ASP.Net 2.0, Integrated Windows Authentication turned on (anonymous turned off) SQL Server 2000 with Windows Only Authentication on (SQL Server authentication turned off) web.config file contains the following relevant entries:<identity impersonate="true" /><authentication mode=Windows" /> connection string:Data Source=[server name]; Integrated Security=SSPI; Initial Catalog=[database name]; When I run my query on my development server, it runs perfectly. When I run it on the production server (which is just an exact xcopy of the development web site...

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

Rubber Tanks and Sonic Trucks: The Ghost Army of World War II
Winston Churchill once told Joseph Stalin “In wartime, truth is so precious that she should always be attended by a bodyguard of lies”. During ...

Emailed threats to NY, LA highlight worries schools face
LOS ANGELES (AP) — When it comes to assessing threats, New York City and Los Angeles schools likely have more experience than most other districts ...

2 Arrested in Austria in Connection to Paris Attacks
TIME 2 Arrested in Austria in Connection to Paris Attacks TIME Two people were arrested at a refugee center in Salzburg, Austria in connection ...

‘Guardians of the Galaxy 2’: ‘Hateful Eight’s’ Kurt Russell Could Play Star Lord’s Father And It’s Not ...
Looks like old Disney and Hateful Eight actor Kurt Russell is being sought after for Guardians of the Galaxy 2 as Star-Lord’s father, according ...

After deadlock, Freddie Gray trial jury presses on
CBS News After deadlock, Freddie Gray trial jury presses on CBS News BALTIMORE - A Baltimore jury is deliberating again, a day after announcing ...

Man Who Claimed He 'Fell' and Penetrated Teen Is Cleared of Rape Charges
Remember the English guy from last week who deflected rape charges by saying he had probably fallen inside his 18-year-old victim? Turns out ...

EU data laws threaten huge fines
A major shake-up of data protection rules in Europe could land tech firms with big fines of up to 4% of their global turnover if they breach ...

Facebook is changing one of its most controversial policies
Facebook is changing the way users can report people's names, according to a blog post . The previous process has come under fire from LGBT ...

‘Super Smash Bros’: Bayonetta And Corrin Join Cloud As Final Three Fighters, Amiibos Coming Too
A Nintendo Direct livestream presented the final new characters for Super Smash Bros. for Nintendo 3DS and Wii U. Final Fantasy VII ‘s Cloud ...

Google Now on Tap eases holiday stress with flight, package tracking
The holidays are fast approaching and, while it's a season for festivity and good cheer, for some it is also a season for hair pulling stress. ...

Resources last updated: 12/16/2015 3:19:17 PM