Friday, March 30, 2012
Login failed for user NT AUTHORITY\NETWORK SERVICE.
"server=(local);Initial Catalog=myDatabase;Trusted_Connection=yes"
when I run my code, there is an error occur with below message:
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'
My SQL Server is configured as Window authentication.
I can't resolve this problem.
Please whow me how to do!
Thank you very much!
You either need to grant the Network Service account access rights toSQL Server, or your application needs to impersonate a specific Windowsuser that has rights to the database.
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'
I get the following error message when I select a report:
My Data source is set to Windows Integrated Security when I get this error message. If I change my data source to be "Credential supplied by the user running the report", the report generates fine. I am running SQL 2005 SP2. I have SQL reporting services installed on different server than my database services. Both servers are W2K3 R2 x64.
My IIS website and virtual directories are set up for Integrated Windows Authentication. My IIS application pool is set up to use an AD service account. I have followed the step/procedures outlined at: http://www.microsoft.com/technet/prodtechnol/windowsserver2003/technologies/security/tkerbdel.mspx
http://blogs.msdn.com/sql_protocols/archive/2005/10/12/479871.aspx
http://blogs.msdn.com/sql_protocols/archive/2006/08/10/694657.aspx
but to no avail. I am sure that I am missing something, but I can't figure out what. I would like to use Integrated Authentication, any ideas? You are using allow anonymous in IIS. This means that your ReportViewer control is not passing the users credentials to the report server. If you want to use "allow anonymous" you will need to pass valid credentials to the report server. This can be done in your code that calls the Report Viewer control/Report Server.|||
Hi,
see more information about passing credentials programmatically here:
http://blogs.msdn.com/bimusings/archive/2005/11/05/489423.aspx
HTH, Jens K. Suessmeyer.
http://www.sqlserver2005.de
|||I don't think that the problem is related to ReportViewer or IIS configuration (Since the credantial information is passed to the datasource and denied). When u select Windows Intedrated Security for report options, the credantials of the user that initiates the Reporting Services at every start up (by default this user is: 'NT AUTHORITY\ANONYMOUS LOGON') are sent to the datasource (And if this user is not authorized in the target database you get the following error).
You can authorize the Reporting Services user in the target database ('NT AUTHORITY\ANONYMOUS LOGON' exists within your SQL Server Machines Users.
or
You can change the Reporting Services' user to a domain user that both computers can authanticate.
Administrative Tools -> Services. (Find 'SQL Server Reporting Services (MSSQLSERVER)' change user from LOG ON tab.)
I hope this helps.
|||Thanks for the replies, but they didn't seem to help. To clear up a few questions, this report was developed in Visual Studio 2005 and it works fine in it. The report renders ok if I launch in on the server, but not anywhere else. My Reporting Services' user is an AD account that both my servers can authenicate against, and this user does have access to the DB. My Website and virtual directories have "allow anonymous access" unchecked.|||I decided to try one more thing. I went into the web.config file and changed the <identity impersonate="false"/> and that fixed it for me. Thanks for all the replies.|||Note:
The above fix will force IIS to use the Application pool account to connect to SQL on the remote server.
This is still not the permanent solution that I am looking for, I believe my problem is a kerberos issue at this point. Any tips/hints/suggestions on troubleshooting this problem would be helpful.
sqlWednesday, March 28, 2012
Login failed for user machinename/ASPNET
Hi all,
I am new to ASP .NET and now I have been messing two days with the connection thing. I use the Visual Studio 2003 provided drag and drop SqlDataAdapter and SqlConnection to connect to the SQL 2000 server, developer edition (configured with the Windows authentication mode), but whenever I tried I always got a "Login failed for user mymachine/ASPNET" error. Can anyone help me with this? I have also tried, as somebody did, adding one line "<identity imperonate="true"/> to the Web.config file, but had the same kind of error. Do I have do make some change to my SQL server?
Thanks a lot!
Charlize
Yes, to resolve the issue completely, you really need to add the ASPNET account to your SQL login and give proper permissions to it. There are lots of similar posts, for example you can take a look at this post:
http://forums.asp.net/thread/1301014.aspx
|||Hi Jay,
Thanks very much for the direction and it was very helpful, now I got it made!
Login failed for user COLDFIRE/ASPNET
this is my connection string
data source=COLDFIRE;initial catalog=Northwind;integrated security=SSPI;persist security info=True;workstation id=COLDFIRE;packet size=4096
i tried this in windows form project of .net and work fine, i connected easily but when i tried it in asp project i got this error :
Login failed for user COLDFIRE/ASPNET
whats wrong with it?That's because the ASPNet user account, which was created when you installed ASP.Net, is not set up as a user on the SQL Server.
Login failed for user ''. The user is not associated with a trusted SQL Server connection. &qu
Hi all,
Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?
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 ''. The user is not associated with a trusted SQL Server connection.
Here is my code and i am using windows authentication:
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%
Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader
connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")
connAkaki.Open()
cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()
While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))
End While
dtrAuthers.Close()
connAkaki.Close()
%>
Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.
The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.
A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:
connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");
In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.
Hope that helps a bit, but sorry if it doesn't
|||
The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.
With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.
Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.
|||Hi All!
How can add the ASP.Net service account as a user in SQL Server 2005?
|||Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:
RESOLUTION
Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".
Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"
If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.
If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:
You have to first login to SQLExpress using osql utility.
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO
Hope that will help.
Derek
|||Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .
All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...
Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.
Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Thanks Gates for forcing my higher "edgeamycashun."
SQL Express for dummies!
Learning SQL is like filing tax returns...put it off to the last minute!
Mike C
Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.
ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page
Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.
Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp
Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute
I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?
I got yarn? but no connection.
Getting closer Watson.
Mike
Login failed for user ''. The user is not associated with a trusted SQL Server connection.
Hi all,
Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?
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 ''. The user is not associated with a trusted SQL Server connection.
Here is my code and i am using windows authentication:
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%
Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader
connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")
connAkaki.Open()
cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()
While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))
End While
dtrAuthers.Close()
connAkaki.Close()
%>
Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.
The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.
A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:
connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");
In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.
Hope that helps a bit, but sorry if it doesn't
|||
The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.
With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.
Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.
|||Hi All!
How can add the ASP.Net service account as a user in SQL Server 2005?
|||Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:
RESOLUTION
Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".
Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"
If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.
If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:
You have to first login to SQLExpress using osql utility.
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO
Hope that will help.
Derek
|||Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .
All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...
Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.
Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Thanks Gates for forcing my higher "edgeamycashun."
SQL Express for dummies!
Learning SQL is like filing tax returns...put it off to the last minute!
Mike C
Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.
ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page
Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.
Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp
Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute
I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?
I got yarn? but no connection.
Getting closer Watson.
Mike
Login failed for user ''. The user is not associated with a trusted SQL Server connection.
Hi all,
Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?
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 ''. The user is not associated with a trusted SQL Server connection.
Here is my code and i am using windows authentication:
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%
Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader
connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")
connAkaki.Open()
cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()
While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))
End While
dtrAuthers.Close()
connAkaki.Close()
%>
Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.
The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.
A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:
connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");
In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.
Hope that helps a bit, but sorry if it doesn't
|||
The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.
With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.
Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.
|||Hi All!
How can add the ASP.Net service account as a user in SQL Server 2005?
|||Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:
RESOLUTION
Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".
Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"
If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.
If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:
You have to first login to SQLExpress using osql utility.
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO
Hope that will help.
Derek
|||Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .
All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...
Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.
Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Thanks Gates for forcing my higher "edgeamycashun."
SQL Express for dummies!
Learning SQL is like filing tax returns...put it off to the last minute!
Mike C
Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.
ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page
Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.
Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp
Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute
I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?
I got yarn? but no connection.
Getting closer Watson.
Mike
Login failed for user ''. The user is not associated with a trusted SQL Server connection.
Hi all,
Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?
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 ''. The user is not associated with a trusted SQL Server connection.
Here is my code and i am using windows authentication:
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%
Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader
connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")
connAkaki.Open()
cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()
While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))
End While
dtrAuthers.Close()
connAkaki.Close()
%>
Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.
The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.
A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:
connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");
In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.
Hope that helps a bit, but sorry if it doesn't
|||
The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.
With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.
Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.
|||Hi All!
How can add the ASP.Net service account as a user in SQL Server 2005?
|||Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:
RESOLUTION
Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".
Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"
If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.
If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:
You have to first login to SQLExpress using osql utility.
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO
Hope that will help.
Derek
|||Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .
All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...
Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.
Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Thanks Gates for forcing my higher "edgeamycashun."
SQL Express for dummies!
Learning SQL is like filing tax returns...put it off to the last minute!
Mike C
Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.
ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page
Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.
Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp
Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute
I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?
I got yarn? but no connection.
Getting closer Watson.
Mike
Login failed for user ''. The user is not associated with a trusted SQL Server connection.
Hi all,
Can someone explain it to me why I am getting the following error when I try to connect SQL server express with .NET 2.0?
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 ''. The user is not associated with a trusted SQL Server connection.
Here is my code and i am using windows authentication:
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>
<%
Dim connAkaki As SqlConnection
Dim cmdSelectAuthers As SqlCommand
Dim dtrAuthers As SqlDataReader
connAkaki = New SqlConnection("Server=.\SQLEXPRESS;database=akaki")
connAkaki.Open()
cmdSelectAuthers = New SqlCommand("select Firstname from UserTableTest", connAkaki)
dtrAuthers= cmdSelectAuthers.ExecuteReader()
While dtrAuthers.Read()
Response.Write("<li>")
Response.Write(dtrAuthers("Firstname"))
End While
dtrAuthers.Close()
connAkaki.Close()
%>
Have you added the ASP.Net service account as a user in SQL Server? The error message is saying that the current user that is trying to connect has not been registered as a login in SQL Server.|||Hi there,I was going to reply to your earlier post on the same/similar topic but since this one's newer I will post here.
The username with which the ASP.NET web application runs is different to the username you used to log into the computer with so chances are that the user is not defined in SQL Server's list of logins and so you get problems when using Windows Authentication.
A way around this is to use SQL Server authentication when trying to access your SQL Server. If you do this, your connection string will be:
connAkai = new System.Data.SqlClient.SqlConnection("Server=.\\NATHAN;database=Northwind; User ID=<SQL Server Login>; Password=<Password For Login>");
In a production system you would probably do more to secure that password (i.e. don't place it plain-text in the code) like putting it in the registry or some other methods but as an example I think it will do.
Hope that helps a bit, but sorry if it doesn't
|||
The SQL Server system by default is set to use only Windows Accounts and not SQL Server authentication, you can turn it on but I would leave it as is and use the windows accounts.
With ASP.Net generally the asp.net system by default runs under the Network Service account, to use it in the database you will need to make sure that the Network Service account has permissions for the database that you are using.
Another option is to make the asp.net application that you are working use a different account, this will help to secure your application. One way to do this is to reconfigure the application pool for the asp.net application that you have and make it run under the new account.
|||Hi All!
How can add the ASP.Net service account as a user in SQL Server 2005?
|||Huh? An MS Knowledge base article (http://support.microsoft.com/kb/555332) says just the opposite:
RESOLUTION
Change the Authentication Mode of the SQL server from "Windows Authentication Mode (Windows Authentication)"
to "Mixed Mode (Windows Authentication and SQL Server Authentication)".
Steps to change SQLExpress to "SQL Server and Windows Authentication Mode"
If you are lucky to have Microsoft SQL server Management Studio installed, then can browse to the SQL server Instance and right-click to bring up the Server Property. Server Property -> Security -> check "SQL Server and Windows Authentication Mode" option under "Server Authentication" section, and then restart the SQLExpress.
If you don't have Microsoft SQL server Management Studio installed, the if you are running on XP Professional, following SQL statements will do the same:
You have to first login to SQLExpress using osql utility.
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'LoginMode', REG_DWORD, 2
GO
Hope that will help.
Derek
|||Hey Glen, I have the same problem only I can't get sqlexpress to allow me to logon in SQL Server Auth mode. I can't even logon using my server (in my house). It will let me log on in Windows Authentication but not SQL Server Authentication? I have nothing on this machine and I reininstalled SQL Express twice. I am the sole admin .
All I want to do is create a blank database (which I did) and log onto it. I watched video 7 on microsoft and opened my fireall udp and added me as doadmin. I added sqlbrowser.exe,sqlserver.exe and udp port 1434 for sql via web in windows firewall. I also opened port 1434 on my hardlinksys router which only has port 80 and 1434 udp opened. (Public Webserver not hacked yet). Eventually, I added all permissions for my self (admin). I right clicked on my new database ("WebWizforums") IE not real database name. I added permissions under my user name and granted all permissions.It's only my user name in permissions noone else. I'll tighten ship perms after I see that she works...
Forum software is what I want to try http://www.webwizguide.com/webwizforums/kb/sql_server_install.asp seems real easy but I can't figure it out? MS Access I knew inside and out but now ...no more MSDE or MSJet on Longhorn OS.
Can anyone explain this simple task "Clearly?" Pretend I have no idea what I'm doing .... Thanks Gates for forcing my higher "edgeamycashun."
SQL Express for dummies!
Learning SQL is like filing tax returns...put it off to the last minute!
Mike C
Ok, I triple checked everything then I rebooted....now it works? I guess start and stop will be learned as stupid sql tricks.
ok, I added the database tables with no problems however, I get this message when I log into the (ADMIN.asp) page
Server Error in Forum Application
An error has occurred while connecting to the database.
Please contact the forum administrator.
Support Error Code:- err_SQLServer_db_connection
File Name:- common.asp
Error details:-
Microsoft OLE DB Provider for SQL Server
Invalid connection string attribute
I searched for Common.asp and right clicked it. It has READ at min. So next is connection String?
I got yarn? but no connection.
Getting closer Watson.
Mike
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!
Al
|||I am using Forms authentication.
<
connectionStrings><
addname="memSocConnection"connectionString=" Data Source=WSPASQL01; Initial Catalog=mem_soc;Integrated Security=True"providerName="System.Data.SqlClient" /><
addname="MySqlRoleManagerConnection"connectionString="Data Source=WSPASQL01;Initial Catalog=mem_soc_core;Integrated Security=True"providerName="System.Data.SqlClient" /><
addname="MySqlMembershipProviderConnection"connectionString="Data Source=WSPASQL01;Initial Catalog=mem_soc_core;Integrated Security=True"providerName="System.Data.SqlClient" /></
connectionStrings><authentication mode="Forms"><formsname="SqlAuthCookie" loginUrl="admin/login.aspx" timeout="10" /> </authentication>
This works fine locally. I am trying to migrate the application onto the servers. As soon as I use the WSPASQL01 server it fails. I have followed the walkthrough from microsoft on using forms authentication and still no progress. I have assigned roles to the login 'aspnet'.
Login failed for user . The user is not associated with a trusted SQL Server connection.
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 toScott 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 i'm authenticating as the SQL credentials instead of me.
So I switch it back to windows authenticated, as it is on my laptop, and it breaks again.
Please tell me theres a way to get this working in production and Scott's fantastic tutorial hasn't wasted me 2 weeks of work.
Here's the exact error I get when using Integrated authentication:
Server Error in '/Contracts' Application.
Login failed for user ''. The user is 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 ''. The user is not associated with a trusted SQL Server connection.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Stack Trace:
[SqlException (0x80131904): Login failed for user ''. The user is not associated with a trusted SQL Server connection.]
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +437
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105
System.Data.SqlClient.SqlConnection.Open() +111
System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +84
System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +197
System.Web.Security.SqlRoleProvider.GetRolesForUser(String username) +771
System.Web.Security.RolePrincipal.IsInRole(String role) +272
System.Web.SiteMapProvider.IsAccessibleToUser(HttpContext context, SiteMapNode node) +194
System.Web.SiteMapNode.IsAccessibleToUser(HttpContext context) +14
System.Web.StaticSiteMapProvider.GetChildNodes(SiteMapNode node) +348
System.Web.SiteMapNode.get_ChildNodes() +23
System.Web.SiteMapNode.get_HasChildNodes() +4
System.Web.SiteMapNode.System.Web.UI.IHierarchyData.get_HasChildren() +4
System.Web.UI.WebControls.Menu.DataBindRecursive(MenuItem node, IHierarchicalEnumerable enumerable) +4225
System.Web.UI.WebControls.Menu.DataBindItem(MenuItem item) +277
System.Web.UI.WebControls.Menu.PerformDataBinding() +117
System.Web.UI.WebControls.HierarchicalDataBoundControl.PerformSelect() +82
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
System.Web.UI.WebControls.Menu.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
System.Web.UI.WebControls.Menu.EnsureDataBound() +29
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e, Boolean registerScript) +21
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e) +22
System.Web.UI.Control.PreRenderRecursiveInternal() +77
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Control.PreRenderRecursiveInternal() +161
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
I am not saying it will fix it but it maybe related to your Windows User/Group not having permission in the database when using Windows Authentication. The database permissions are in the new security section in the database in Management Studio. Hope this helps.|||Can you post your Web.config file?sql
Login failed for user ''. Reason: Not associated with a trusted SQL Server connection.
Hi,
I have 2 windows 2003 server, i instllaed sql server 2005 enterprise edition on the first one (Mixed Mode), and i am trying to install sql server reporting 2000 on the second one,
I installed the sql 2000 connectivity only on the second one , and i installed the sql server sp4 also, while installing reporting services i used the sql login account (sa,pwd)
i got the following error :
Cannot connect to sql server instance ...
Login failed for user ''. Reason: Not associated with a trusted SQL Server connection.
NB1: Allow Remote connection is enabled on sql server 2005.
NB2: I tried to connect from server 2 to server 1 from odbc and it worked properly with (sa,pwd) i have only a problem from reporting server.
Please any help?
Tarek Ghazali
SQL Server MVP
Are the machines in the same domain? What is the network configuration? What does "sql 2000 connectivity" mean?
Have you checked the errorlog? Is there any additional information on the failure there?
Try running a Profiler trace on the SQL Server machine to see if you can find any additional information on the login attempt.
Thanks
Laurentiu
Here's a thread that may be related to the issue you are seeing: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=422598&SiteID=1
Thanks
Laurentiu
Hi Laurentiu,
Thx for your reply,
I have 2 servers on the same domain and under vmware virtual
server (the new release beta 2) ,about sql 2000 connectivity you can install sql server 2000 as (database server or client or connectivity).
I don't have any log error.
Thanks,
Tarek Ghazali
SQL Server MVP
|||Login failures are normally logged. Are you sure you checked the log on the right server - the one you were trying to connect to? Also, have you got any insights from running a Profiler trace?
Thanks
Laurentiu
Hi Laurentiu,
I created a user on the domain , and i logged on windows by this user on the second server, i added this user to have access login on the first server and it worked fine.
Regards,
Tarek Ghazali
SQL Server MVP
Login failed for user ''. Reason: Not associated with a trusted SQL Server connection.
Hi,
I have 2 windows 2003 server, i instllaed sql server 2005 enterprise edition on the first one (Mixed Mode), and i am trying to install sql server reporting 2000 on the second one,
I installed the sql 2000 connectivity only on the second one , and i installed the sql server sp4 also, while installing reporting services i used the sql login account (sa,pwd)
i got the following error :
Cannot connect to sql server instance ...
Login failed for user ''. Reason: Not associated with a trusted SQL Server connection.
NB1: Allow Remote connection is enabled on sql server 2005.
NB2: I tried to connect from server 2 to server 1 from odbc and it worked properly with (sa,pwd) i have only a problem from reporting server.
Please any help?
Tarek Ghazali
SQL Server MVP
Are the machines in the same domain? What is the network configuration? What does "sql 2000 connectivity" mean?
Have you checked the errorlog? Is there any additional information on the failure there?
Try running a Profiler trace on the SQL Server machine to see if you can find any additional information on the login attempt.
Thanks
Laurentiu
Here's a thread that may be related to the issue you are seeing: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=422598&SiteID=1
Thanks
Laurentiu
Hi Laurentiu,
Thx for your reply,
I have 2 servers on the same domain and under vmware virtual
server (the new release beta 2) ,about sql 2000 connectivity you can install sql server 2000 as (database server or client or connectivity).
I don't have any log error.
Thanks,
Tarek Ghazali
SQL Server MVP
|||Login failures are normally logged. Are you sure you checked the log on the right server - the one you were trying to connect to? Also, have you got any insights from running a Profiler trace?
Thanks
Laurentiu
Hi Laurentiu,
I created a user on the domain , and i logged on windows by this user on the second server, i added this user to have access login on the first server and it worked fine.
Regards,
Tarek Ghazali
SQL Server MVP
sql
Login failed for user ''. Reason: Not associated with a trusted SQL Server connection
Hello, here we have 2 developers, one developer has sql 2005 in his machine, the connection string has Integrated Security=SSPI, that developer can connect to the application, the other user gets that error when he tries to execute the application froms its own IIS.
The sql server has windows authentication, I want that the application uses one account, I tried to create one account, and give db_owner to it on the database, then I changed the connection string and it happens the same thing.
TKS
Did you eleminate the userid and password word in the connection string ? COuld you please post the whole message you are getting while connecting ? Didi you setup the IIS for a built in user account to run with or do you use delegation within your application ?HTH, jens Suessmeyer.|||
This issue was reposted in the following thread:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=285649&SiteID=1
Thanks
Laurentiu
Login Failed for user , the user is not associated with a trusted sql server connection. (micros
Login Failed for user , the user is not associated with a trusted sql server connection. (microsoft SQL Server,Error:18452)
hi ,
i am getting the above error message once in a while maybe two or 3 times a week , and then it goes away in 10 to 15 minutes or 5 minutes ,
our mode is set to mixed and we are able to connect and use both sql and windows , but once in a while , it will give us the above message when we try connecting throught sql server management studio client (using sql 05) using windows login , although it lets us connect using sql login while the windows login is denied, and after a while it lets us connect with both.
occurs randomly on some days , we run our servers on VM ware virtual machines using windows 2003 r2 enterprise 64 bit with sp2 with esx 301 virtual machine.
would appericate any feedback on this thanks
Are you connecting using domain logins or local logins? If they are domain logins, you may experience issues querying the domain controller and these could cause the login failures.
Please also check the server error log (assuming that you are running SQL Server 2005) and tell us the error state. You could also use the security error ring buffer to see if you can get additional information on which Windows API is failing (requires SP2 - see http://blogs.msdn.com/lcris/archive/2007/02/19/sql-server-2005-some-new-security-features-in-sp2.aspx).
Thanks
Laurentiu
|||hi ,
this is the error i can see been logged in the sql server agent log files
Date 19/07/2007 9:35:00 AM
Log SQL Agent (Current - 19/07/2007 11:08:00 AM)
Message
[298] SQLServer Error: 15404, Could not obtain information about Windows NT group/user 'POWAT\kena', error code 0x6ba. [SQLSTATE 42000] (ConnIsLoginSysAdmin)
Hi,
the error message in the log is self explainatery, make sure your NT User exists in domain POWAT, and trust relationship between domain and SQL Server are well established. also suggest to take a closer look at windows event viewer for more information.
Regards
Hemantgiri S. Goswami
|||Hello you i have used aconnection string but it says the the user is not associated with trusted sql server connection, but the server is also in a mix mode but still i am recieving errors and one more thing if i give username and password it does not display my username at the error
Thanks
Vishy007
Monday, March 26, 2012
Login Failed for user , the user is not associated with a trusted sql server connection. (micros
Login Failed for user , the user is not associated with a trusted sql server connection. (microsoft SQL Server,Error:18452)
hi ,
i am getting the above error message once in a while maybe two or 3 times a week , and then it goes away in 10 to 15 minutes or 5 minutes ,
our mode is set to mixed and we are able to connect and use both sql and windows , but once in a while , it will give us the above message when we try connecting throught sql server management studio client (using sql 05) using windows login , although it lets us connect using sql login while the windows login is denied, and after a while it lets us connect with both.
occurs randomly on some days , we run our servers on VM ware virtual machines using windows 2003 r2 enterprise 64 bit with sp2 with esx 301 virtual machine.
would appericate any feedback on this thanks
Are you connecting using domain logins or local logins? If they are domain logins, you may experience issues querying the domain controller and these could cause the login failures.
Please also check the server error log (assuming that you are running SQL Server 2005) and tell us the error state. You could also use the security error ring buffer to see if you can get additional information on which Windows API is failing (requires SP2 - see http://blogs.msdn.com/lcris/archive/2007/02/19/sql-server-2005-some-new-security-features-in-sp2.aspx).
Thanks
Laurentiu
|||hi ,
this is the error i can see been logged in the sql server agent log files
Date 19/07/2007 9:35:00 AM
Log SQL Agent (Current - 19/07/2007 11:08:00 AM)
Message
[298] SQLServer Error: 15404, Could not obtain information about Windows NT group/user 'POWAT\kena', error code 0x6ba. [SQLSTATE 42000] (ConnIsLoginSysAdmin)
Hi,
the error message in the log is self explainatery, make sure your NT User exists in domain POWAT, and trust relationship between domain and SQL Server are well established. also suggest to take a closer look at windows event viewer for more information.
Regards
Hemantgiri S. Goswami
|||Hello you i have used aconnection string but it says the the user is not associated with trusted sql server connection, but the server is also in a mix mode but still i am recieving errors and one more thing if i give username and password it does not display my username at the error
Thanks
Vishy007
login failed for user '(null)'| trusted connection
login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
When I upload the report rdl to our server and use an established data source the report works fine.
I have two questions. 1) Why would this error occur and 2) how do I fix it?
My guess is that I have to restablish a conenction to a working datasource but I don't know how to do it.
Any help would be greatly appreciated.
Thanks.
Is your datasource set to use integrated security? If so then you are probably hitting the double-hop problem.
http://blogs.msdn.com/jgalla/archive/2006/03/16/553314.aspx
|||I'm looking into this now but as some reports work and I can remake this report so that it functions I think it might have to be the report itself.This report uses a private data source and I suspect that there might be a problem with it. How can I change a private data source without editing the RDL manually?
Again thank you for the help.|||I suspect that the reports that are functioning are using different credential options. You can view how the data sources are configured in Report Manager from the "Data Sources" tab for each report.|||I've received the same error but under different circumstances :
Login failed for user ". The user is not associated with trusted SQL Server connection.
The datasource is connecting to the database using SQL Server
Authentication. First time round this report previews fine.
I then copy and paste the report to obtain an identical one (with the
name of "Copy of report1") and then try and preview this new report,
but get the above error. The original report still works
fine. In the copy, all the dataset queries work fine when run
individually, the error only comes when i try and preview the
report. Any ideas why this is happening?
Guy|||Further to the previous post...
I later closed the original report and reopened it to find the original
gave the same error as above. After much investagation it
appeared that the datasets had somehow changed there datasources.
They were all pointing at datasources with the correct names, but not
shared ones - i dont recall setting up any that were not shared,
and they certainly are not showing in the solution explorer.
On re-pointing the sets to the correct shared sources it now all works
fine and copy and pastes fine too. But why should they have
changed during a copy and paste and even during a save and
reopen? ?
login failed for user '(null)'| trusted connection
login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection
When I upload the report rdl to our server and use an established data source the report works fine.
I have two questions. 1) Why would this error occur and 2) how do I fix it?
My guess is that I have to restablish a conenction to a working datasource but I don't know how to do it.
Any help would be greatly appreciated.
Thanks.
Is your datasource set to use integrated security? If so then you are probably hitting the double-hop problem.
http://blogs.msdn.com/jgalla/archive/2006/03/16/553314.aspx
|||I'm looking into this now but as some reports work and I can remake this report so that it functions I think it might have to be the report itself.This report uses a private data source and I suspect that there might be a problem with it. How can I change a private data source without editing the RDL manually?
Again thank you for the help.
|||I suspect that the reports that are functioning are using different credential options. You can view how the data sources are configured in Report Manager from the "Data Sources" tab for each report.|||I've received the same error but under different circumstances :
Login failed for user ". The user is not associated with trusted SQL Server connection.
The datasource is connecting to the database using SQL Server Authentication. First time round this report previews fine. I then copy and paste the report to obtain an identical one (with the name of "Copy of report1") and then try and preview this new report, but get the above error. The original report still works fine. In the copy, all the dataset queries work fine when run individually, the error only comes when i try and preview the report. Any ideas why this is happening?
Guy|||Further to the previous post...
I later closed the original report and reopened it to find the original gave the same error as above. After much investagation it appeared that the datasets had somehow changed there datasources. They were all pointing at datasources with the correct names, but not shared ones - i dont recall setting up any that were not shared, and they certainly are not showing in the solution explorer.
On re-pointing the sets to the correct shared sources it now all works fine and copy and pastes fine too. But why should they have changed during a copy and paste and even during a save and reopen? ?sql
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
I'm new here guys.
I'm developing a web application that's using a separate component to access data from SQL Server 2000. This component uses DAAB of EL June 2005. This data access component resides on a different server from the database server. I would just like to ask if what's the cause of this error. I wonder why it doesn't get the actual user I'm passing?
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection."
Our database admin had the database server in mixed mode authentication already.
I don't know if this will help but I'll share the contents of my config files.
web.config contains:
<enterpriselibrary.configurationSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" applicationName="Application" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/configuration">
<configurationSections>
<configurationSection xsi:type="ReadOnlyConfigurationSectionData" name="dataConfiguration" encrypt="false">
<storageProvider xsi:type="XmlFileStorageProviderData" name="XML File Storage Provider" path="dataConfiguration.config" />
<dataTransformer xsi:type="XmlSerializerTransformerData" name="Xml Serializer Transformer">
<includeTypes />
</dataTransformer>
</configurationSection>
</configurationSections>
<keyAlgorithmStorageProvider xsi:nil="true" />
<includeTypes />
</enterpriselibrary.configurationSettings>
dataconfiguration.config contains
<?xml version="1.0" encoding="utf-8"?>
<dataConfiguration>
<xmlSerializerSection type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null">
<enterpriseLibrary.databaseSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" defaultInstance="something" xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/data">
<databaseTypes>
<databaseType name="Sql Server" type="Microsoft.Practices.EnterpriseLibrary.Data.Sql.SqlDatabase, Microsoft.Practices.EnterpriseLibrary.Data, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null" />
</databaseTypes>
<instances>
<instance name="something" type="Sql Server" connectionString="something" />
</instances>
<connectionStrings>
<connectionString name="something">
<parameters>
<parameter name="data source" value="dbserver" isSensitive="false" />
<parameter name="initial catalog" value="dbname" isSensitive="false" />
<parameter name="Integrated Security" value="SSPI" isSensitive="false" />
<parameter name="password" value="password" isSensitive="true" />
<parameter name="user id" value="userid" isSensitive="false" />
</parameters>
</connectionString>
</connectionStrings>
</enterpriseLibrary.databaseSettings>
</xmlSerializerSection>
</dataConfiguration>
Also, do I need to create an app.config and another dataconfiguration.config files in my data access component?
Hoping for your replies guys. Thanks in advance!
This KB can help you.
http://support.microsoft.com/default.aspx/kb/307002.
Login failed for user (null). Reason: Not associated with a trusted SQL Server connection.
I have a user "john" whose machine is part of the "job" domain. He is
trying to establish an odbc connection to an MS SQL 2000 server on the
"school" domain. He uses Windows authentication to establish the odbc
connection however it gives the error "Login failed for user '(null)'.
Reason: Not associated with a trusted SQL Server connection."
I am guessing that the odbc connection is trying to pass the
credentials of job\john to the sql server. And since the sql server
is on the school domain it expects the credentials of school\john. Is
there anyway to specify the username and password so that this will
work even though the servers are on different domains without having
to trust the domains? Thanks in advance for
any help on this!!
TonyTo log into SQL Server, the user needs a SQL Server login. If your SQL
Server is set up to use NT Authentication or mixed mode authentication on
the Schools domain, then give John a login on the Schools domain and have
him login using those credentials.
"TBone" <tony.despain@.gmail.com> wrote in message
news:64b1ef71.0411261033.1044c9e9@.posting.google.c om...
> Anyone,
> I have a user "john" whose machine is part of the "job" domain. He is
> trying to establish an odbc connection to an MS SQL 2000 server on the
> "school" domain. He uses Windows authentication to establish the odbc
> connection however it gives the error "Login failed for user '(null)'.
> Reason: Not associated with a trusted SQL Server connection."
> I am guessing that the odbc connection is trying to pass the
> credentials of job\john to the sql server. And since the sql server
> is on the school domain it expects the credentials of school\john. Is
> there anyway to specify the username and password so that this will
> work even though the servers are on different domains without having
> to trust the domains? Thanks in advance for
> any help on this!!
> Tony|||Hi
The school domain needs to trust the job domain to allow this to occur. You
could use SQL Server authentication instead if you don't want this trust to
occur.
John
"TBone" <tony.despain@.gmail.com> wrote in message
news:64b1ef71.0411261033.1044c9e9@.posting.google.c om...
> Anyone,
> I have a user "john" whose machine is part of the "job" domain. He is
> trying to establish an odbc connection to an MS SQL 2000 server on the
> "school" domain. He uses Windows authentication to establish the odbc
> connection however it gives the error "Login failed for user '(null)'.
> Reason: Not associated with a trusted SQL Server connection."
> I am guessing that the odbc connection is trying to pass the
> credentials of job\john to the sql server. And since the sql server
> is on the school domain it expects the credentials of school\john. Is
> there anyway to specify the username and password so that this will
> work even though the servers are on different domains without having
> to trust the domains? Thanks in advance for
> any help on this!!
> Tony