Showing posts with label associated. Show all posts
Showing posts with label associated. Show all posts

Wednesday, March 28, 2012

login failed for user ... Not Associated with a trusted SQL Server

Hello,
I'm trying to connect a mobile computer runing under windows CE to a
database located on a windows XP desktop.
The mobile computer application is written in C# under Visual Studio .NET
2003.
My problem occurs when I execute mConnection.Open();
A SqlException is caught with this message :
Login failed for user '(null)'. Reason : Not associated with a trusted SQL
Server connection.
here is the connection string :
mConnection = new SqlConnection("User ID=sa;data source=" + mSqlServer +
";Integrated Security=SSPI;initial catalog=IDPS;Password=xxxx;persist
security info=false;Trusted_Connection=yes");
What can I do to correct it ?
In your connection string, you are specifying parameters for
both SQL authentication and Windows authentication - it
needs to be one or the other. If you use Windows
authentication, you don't specify a user id and password.
You can find some examples at:
http://www.carlprothman.net/Default...anagedProvider
-Sue
On Tue, 2 Aug 2005 07:56:11 -0700, Christian F CLY
<ChristianFCLY@.discussions.microsoft.com> wrote:

>Hello,
>I'm trying to connect a mobile computer runing under windows CE to a
>database located on a windows XP desktop.
>The mobile computer application is written in C# under Visual Studio .NET
>2003.
>My problem occurs when I execute mConnection.Open();
>A SqlException is caught with this message :
>Login failed for user '(null)'. Reason : Not associated with a trusted SQL
>Server connection.
>here is the connection string :
>mConnection = new SqlConnection("User ID=sa;data source=" + mSqlServer +
>";Integrated Security=SSPI;initial catalog=IDPS;Password=xxxx;persist
>security info=false;Trusted_Connection=yes");
>What can I do to correct it ?

login failed for user ... Not Associated with a trusted SQL Server

Hello,
I'm trying to connect a mobile computer runing under windows CE to a
database located on a Windows XP desktop.
The mobile computer application is written in C# under Visual Studio .NET
2003.
My problem occurs when I execute mConnection.Open();
A SqlException is caught with this message :
Login failed for user '(null)'. Reason : Not associated with a trusted SQL
Server connection.
here is the connection string :
mConnection = new SqlConnection("User ID=sa;data source=" + mSqlServer +
";Integrated Security=SSPI;initial catalog=IDPS;Password=xxxx;persist
security info=false;Trusted_Connection=yes");
What can I do to correct it ?In your connection string, you are specifying parameters for
both SQL authentication and Windows authentication - it
needs to be one or the other. If you use Windows
authentication, you don't specify a user id and password.
You can find some examples at:
http://www.carlprothman.net/Default...ManagedProvider
-Sue
On Tue, 2 Aug 2005 07:56:11 -0700, Christian F CLY
<ChristianFCLY@.discussions.microsoft.com> wrote:

>Hello,
>I'm trying to connect a mobile computer runing under windows CE to a
>database located on a Windows XP desktop.
>The mobile computer application is written in C# under Visual Studio .NET
>2003.
>My problem occurs when I execute mConnection.Open();
>A SqlException is caught with this message :
>Login failed for user '(null)'. Reason : Not associated with a trusted SQL
>Server connection.
>here is the connection string :
>mConnection = new SqlConnection("User ID=sa;data source=" + mSqlServer +
>";Integrated Security=SSPI;initial catalog=IDPS;Password=xxxx;persist
>security info=false;Trusted_Connection=yes");
>What can I do to correct it ?sql

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 .... Smile 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 .... Smile 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 .... Smile 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 .... Smile 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 .... Smile 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 ''. The user is not associated with a trusted SQL Server connectio

My machine has Win XP and IIS 5.1.
I installed Visual Studio 2005 without SQL Express 2005. SQL Server
2005 is installed on another machine with Win 2003.
I created a Web Site in .NET VB. I created a connection with my SQL
server database, I can retrieve/ change data in SERVER EXPLORER. When I
try to create a gridview with data fron one table and to run the web
page in Internet Explorer I receive the following error.
Login failed for user ''. The user is not associated with a trusted SQL
Server connection.
Can you please help me ?
Which connection string are you using to connect to the database, I
guess you are using SQL Server authentication which isn=B4t setup
properly on your computer.
So switch to mixed authentication, or use a Windows account to connect
to the database-
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||Which connection string are you using to connect to the database, I
guess you are using SQL Server authentication which isn=B4t setup
properly on your computer.
So switch to mixed authentication, or use a Windows account to connect
to the database-
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||Hi
How do you set up your database? A Windows Authenication or Mixed?
<CLarkou@.gmail.com> wrote in message
news:1142862649.046140.21050@.z34g2000cwc.googlegro ups.com...
> My machine has Win XP and IIS 5.1.
> I installed Visual Studio 2005 without SQL Express 2005. SQL Server
> 2005 is installed on another machine with Win 2003.
> I created a Web Site in .NET VB. I created a connection with my SQL
> server database, I can retrieve/ change data in SERVER EXPLORER. When I
> try to create a gridview with data fron one table and to run the web
> page in Internet Explorer I receive the following error.
> Login failed for user ''. The user is not associated with a trusted SQL
> Server connection.
> Can you please help me ?
>
|||I am using the following:
<remove name="LocalSqlServer" />
<add name="SubDispConnectionString1" connectionString="Data
Source=CYNICSQL1;Initial Catalog=SubDisp;Integrated Security=True"
providerName="System.Data.SqlClient" />
|||Hi, I set it as "Integrated Security=True"
|||No, this is just the connection string, not themode SQL Server is set
to. The one (COnnectionString) is the client, the authentication mode
(mixed) is the server side.
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||The reason people keep asking about authentication modes is that this error
message usually means you are trying to connect with a SQL Server login to a
SQL Server instance that only supports Windows authentication. It sounds
like this is not your issue because you are connecting with Integrated
Security and not supplying a user name or password. The other possible
cause is that the Windows user has no right to authenticate a Windows
connection on the server where SQL Server is running. This can be a "double
hop" error if you are using Windows authentication on the Web site. It
could also be a case that ASPUSER has no rights to connect to the SQL Server
machine.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
<CLarkou@.gmail.com> wrote in message
news:1142867073.546213.317310@.t31g2000cwb.googlegr oups.com...
> Hi, I set it as "Integrated Security=True"
>
|||I tried creating a website with FILE SYSTEM, not HTTP, and I was able
to open the web page in IE with SQL server data. ASPUSER is used for
connecting to the SQL SERVER machine with FILE SYSTEM web site ?
|||The server authentication is "Windows Authentication Mode".

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)... Failure to reserve contiguous memory

Symptom:
Login failed for user '(null)'. Reason: Not associated with a trusted SQL Se
rve
2004-03-04 19:46:07.40 spid125 WARNING: Failed to reserve contiguous memor
y of Size= 65536.
2004-03-04 19:46:07.42 spid125 Query Memory Manager: Grants=0 Waiting=0 Ma
ximum=23010 Available=23010
2004-03-04 19:46:07.42 spid125 Global Memory Objects: Resource=1702 Locks=
76 ...
2004-03-04 19:46:07.42 spid125 Dynamic Memory Manager: Stolen=191349 OS Re
served=40424 ...
2004-03-04 19:46:07.42 spid125 Procedure Cache: TotalProcs=9843 TotalPages
=15049 InUsePages=2369
2004-03-04 19:46:07.42 spid125 Buffer Counts: Commited=208704 Target=20870
4 Hashed=17343...
2004-03-04 19:46:07.42 spid125 Buffer Distribution: Stolen=176300 Free=12
Procedures=15049...Larry, you may want to look at Microsoft KB article 818095. The symptoms you
have listed are very close to what is described in that article. The good n
ews for you is that Microsoft has a fix if the symptoms match.

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

Hi guys,

I have a problem:

I have a created a vb.net app.

From this vb.net App (in server A) I connect to the SQL server SP4 (in serverA) and to a SQLServer 2000 SP4 in another server (server B).
All connection are with trusted_connection = true. Server A and B are in a domain.

After pressed a button, (when I run the button I am logged as a domain administrator) some store procedures and table are created in SQL server A and B.

During this phase everything is OK, I mean tables and store procs are installed correctly, and Linked server are installed.

The problem is that:at the end of this job a store aprocedure (in server B) is called form which has a sql statement (SQL select ...inner join from table in different sql server A,B),
the vb.net app show an error:

"System.Data.SQLClient.SqlExcemption: Login failed for user '(null)'. Reason: Not associated with a trusted SQL server connection"

Linked server is:

Local Login: domain\administrator
Impersonate: true
RMUser and Pw are null
Selected: Be made using the login's current security context

SQL server is win + SQL auth mode.

and account: System Account

Do you know how to solve the problem.

I tried to modify option in Linked server but is the same.

I replaced the conn string in vb.net with user and pass and everything work.
So, it looks like that using windows account credential used are lost.

Any help will be very appreciated

For .NET related questions, please see the Data Access forum in the .NET group.

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

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

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

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

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

Hello:
I've just upgraded Windows 2000 server to Windows server 2003, and after
this I cannot get to the SQL server Enterprise manager, I'm getting error
"Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection"
I've found many articles about it, but they are all about problems with ASP
or ASP.Net. I don't have a problem with ASP.Net, my Intranet application is
running OK.
I still can get in using SQL server connection if I change the registration
properties, but if I use Trusted connections I get this error. And I need to
use trusted connections.
I would appreciate any help very much.
Thank you,
Peter Afonin
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> I've just upgraded Windows 2000 server to Windows server 2003, and after
> this I cannot get to the SQL server Enterprise manager, I'm getting error
> "Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection"
> I've found many articles about it, but they are all about problems with
ASP
> or ASP.Net. I don't have a problem with ASP.Net, my Intranet application
is
> running OK.
> I still can get in using SQL server connection if I change the
registration
> properties, but if I use Trusted connections I get this error. And I need
to
> use trusted connections.
If you enable auditing on both the server and SQL Server, do you see any
failed login attempts? If so, which account is being used?
Steve
|||"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...

> I've just upgraded Windows 2000 server to Windows server 2003, and after
> this I cannot get to the SQL server Enterprise manager, I'm getting error
> "Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection"
> I've found many articles about it, but they are all about problems with
ASP
> or ASP.Net. I don't have a problem with ASP.Net, my Intranet application
is
> running OK.
> I still can get in using SQL server connection if I change the
registration
> properties, but if I use Trusted connections I get this error. And I need
to
> use trusted connections.
Moments after I posted the last message, I found this link which may be of
value to you:
How to troubleshoot connectivity issues in SQL Server 2000
http://www.support.microsoft.com/?id=827422
Steve
|||Peter,
CAUSE
This error occurs because the SQL Server is configured to use "Windows only"
authentication.
RESOLUTION
On the SQL Server Security tab, configure SQL Server to use "SQL Server and
Windows" authentication.
Russell Fields
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> Hello:
> I've just upgraded Windows 2000 server to Windows server 2003, and after
> this I cannot get to the SQL server Enterprise manager, I'm getting error
> "Login failed for user '(null)'. Reason: Not associated with a trusted SQL
> Server connection"
> I've found many articles about it, but they are all about problems with
ASP
> or ASP.Net. I don't have a problem with ASP.Net, my Intranet application
is
> running OK.
> I still can get in using SQL server connection if I change the
registration
> properties, but if I use Trusted connections I get this error. And I need
to
> use trusted connections.
> I would appreciate any help very much.
> Thank you,
> --
> Peter Afonin
>
|||Thank you, but it's configured this way.
Peter
"Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
news:O4mPpDUMEHA.624@.TK2MSFTNGP11.phx.gbl...
> Peter,
> CAUSE
> This error occurs because the SQL Server is configured to use "Windows
only"
> authentication.
> RESOLUTION
> On the SQL Server Security tab, configure SQL Server to use "SQL Server
and[vbcol=seagreen]
> Windows" authentication.
> Russell Fields
> "Peter Afonin" <pva@.speakeasy.net> wrote in message
> news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...
error[vbcol=seagreen]
SQL[vbcol=seagreen]
> ASP
> is
> registration
need
> to
>
|||Thank you, Steve.
I'm working on it, buy now I even cannot get in with my administrative (sa)
account. I don't know what's wrong.
Peter
"Steve Thompson" <SteveThompson@.nomail.please> wrote in message
news:uD1X1CUMEHA.3596@.tk2msftngp13.phx.gbl...[vbcol=seagreen]
> "Peter Afonin" <pva@.speakeasy.net> wrote in message
> news:uv2RYZTMEHA.2500@.TK2MSFTNGP12.phx.gbl...
error[vbcol=seagreen]
SQL[vbcol=seagreen]
> ASP
> is
> registration
need
> to
> Moments after I posted the last message, I found this link which may be of
> value to you:
> How to troubleshoot connectivity issues in SQL Server 2000
> http://www.support.microsoft.com/?id=827422
> Steve
>
|||By chance, did you change the security mode and not restart MSSQLServer
service?
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:OVxnWVUMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> Thank you, Steve.
> I'm working on it, buy now I even cannot get in with my administrative
(sa)[vbcol=seagreen]
> account. I don't know what's wrong.
> Peter
> "Steve Thompson" <SteveThompson@.nomail.please> wrote in message
> news:uD1X1CUMEHA.3596@.tk2msftngp13.phx.gbl...
after[vbcol=seagreen]
> error
> SQL
with[vbcol=seagreen]
application[vbcol=seagreen]
> need
of
>
|||Peter,
Do you get the same error when logging in as 'sa'? If so, that is telling
you that the server is not accepting standard SQL logins, no matter what the
settings seems to be.
Do you have a domain account with sysadmin rights that you can login with?
If so, try that one.
During the upgrade of your server, did you lose any local Windows accounts?
Domain accounts? Look at article:
http://support.microsoft.com/default...b;en-us;307002
Russell Fields
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:OVxnWVUMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> Thank you, Steve.
> I'm working on it, buy now I even cannot get in with my administrative
(sa)[vbcol=seagreen]
> account. I don't know what's wrong.
> Peter
> "Steve Thompson" <SteveThompson@.nomail.please> wrote in message
> news:uD1X1CUMEHA.3596@.tk2msftngp13.phx.gbl...
after[vbcol=seagreen]
> error
> SQL
with[vbcol=seagreen]
application[vbcol=seagreen]
> need
of
>
|||OK. The (null) probably suggests the comment in my other post. (Unless
'sa' is returning a similar message.)
IF in the unlikely event that your registry is messed up:
http://support.microsoft.com/default...b;en-us;285097
Russell Fields
"Peter Afonin" <pva@.speakeasy.net> wrote in message
news:uNK2oUUMEHA.3216@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> Thank you, but it's configured this way.
> Peter
> "Russell Fields" <RussellFields@.NoMailPlease.Com> wrote in message
> news:O4mPpDUMEHA.624@.TK2MSFTNGP11.phx.gbl...
> only"
> and
after[vbcol=seagreen]
> error
> SQL
with[vbcol=seagreen]
application
> need
>
|||I did restart it, thanks.
Peter
"Steve Thompson" <SteveThompson@.nomail.please> wrote in message
news:e1RnoaUMEHA.1556@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> By chance, did you change the security mode and not restart MSSQLServer
> service?
> "Peter Afonin" <pva@.speakeasy.net> wrote in message
> news:OVxnWVUMEHA.2500@.TK2MSFTNGP12.phx.gbl...
> (sa)
> after
trusted[vbcol=seagreen]
> with
> application
be
> of
>