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

R

rrober07

Hello,

My Setup is I have a Web Server machine(Devweb01), Database SQL
Machine(Devsql01), a Client Machine(local machine) I have configured the
SQL machine as follows:
1) Added local Aspnet user account (with same password as aspnet user on IIS
(Devweb01))
2) edited local machine.config file <ProcessModel> Password attribute to
same password (both on IIS and SQL Machine)
3) SQL Server security is Sql Server and Windows
4) Create a sql login for aspnet user account and applied to local window
aspnet user account

I am getting the following error when I run my Web app:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user
'(null)'. Reason: 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: Login failed for user '(null)'. Reason: Not associated with a
trusted SQL Server connection.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) +474

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application
Blocks for .NET\Data
Access\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:142
LDSWebAuthorize.WebUsers.UserLoginValidate(String UserName, String
Password) in C:\Documents and Settings\richardr\My Documents\Visual Studio
Projects\LDSWebAuthorize\WebUsers.vb:261
WebAppJudah.Login.btnLogin_Click(Object sender, EventArgs e) in
\\devweb01\wwwroot$\Judah\TestSite\WebAppJudah\Login.aspx.vb:48
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277



Any ideas what is causing this error???


Thanks in advance!!

Richard
 
H

Hermit Dave

well i actually dont know if all this things are required as such.

All you need to do is configure the devweb01/aspnet user to have atleast
public role in sql server.
Once you do that you can use trusted connection between the boxes.

The error message you are getting is because the devweb01/aspnet user doesnt
have access. dont think creating a local user on devsql01 with name aspnet
would help

chao

HD

rrober07 said:
Hello,

My Setup is I have a Web Server machine(Devweb01), Database SQL
Machine(Devsql01), a Client Machine(local machine) I have configured the
SQL machine as follows:
1) Added local Aspnet user account (with same password as aspnet user on IIS
(Devweb01))
2) edited local machine.config file <ProcessModel> Password attribute to
same password (both on IIS and SQL Machine)
3) SQL Server security is Sql Server and Windows
4) Create a sql login for aspnet user account and applied to local window
aspnet user account

I am getting the following error when I run my Web app:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user
'(null)'. Reason: 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: Login failed for user '(null)'. Reason: Not associated with a
trusted SQL Server connection.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) +474

System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application
Blocks for .NET\Data
Access\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:142
LDSWebAuthorize.WebUsers.UserLoginValidate(String UserName, String
Password) in C:\Documents and Settings\richardr\My Documents\Visual Studio
Projects\LDSWebAuthorize\WebUsers.vb:261
WebAppJudah.Login.btnLogin_Click(Object sender, EventArgs e) in
\\devweb01\wwwroot$\Judah\TestSite\WebAppJudah\Login.aspx.vb:48
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108

System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277



Any ideas what is causing this error???


Thanks in advance!!

Richard
 
R

rrober07

Thanks for the reply/..BUT
I Do have this login granted access to the public role for the database that
I want access to. I was able to access via local IIS machine (running
WindowXp) but I can't get it to work using remote IIS machine Windows2003
Server. (so I know that the SQL Server is working OK) It must be something
with the Web Server and IIS

any other Ideas...
Thanks!
Richard


Hermit Dave said:
well i actually dont know if all this things are required as such.

All you need to do is configure the devweb01/aspnet user to have atleast
public role in sql server.
Once you do that you can use trusted connection between the boxes.

The error message you are getting is because the devweb01/aspnet user doesnt
have access. dont think creating a local user on devsql01 with name aspnet
would help

chao

HD

rrober07 said:
Hello,

My Setup is I have a Web Server machine(Devweb01), Database SQL
Machine(Devsql01), a Client Machine(local machine) I have configured the
SQL machine as follows:
1) Added local Aspnet user account (with same password as aspnet user on IIS
(Devweb01))
2) edited local machine.config file <ProcessModel> Password attribute to
same password (both on IIS and SQL Machine)
3) SQL Server security is Sql Server and Windows
4) Create a sql login for aspnet user account and applied to local window
aspnet user account

I am getting the following error when I run my Web app:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for user
'(null)'. Reason: 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: Login failed for user '(null)'. Reason: Not associated
with
a
trusted SQL Server connection.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application
Blocks for .NET\Data
Access\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:142
LDSWebAuthorize.WebUsers.UserLoginValidate(String UserName, String
Password) in C:\Documents and Settings\richardr\My Documents\Visual Studio
Projects\LDSWebAuthorize\WebUsers.vb:261
WebAppJudah.Login.btnLogin_Click(Object sender, EventArgs e) in
\\devweb01\wwwroot$\Judah\TestSite\WebAppJudah\Login.aspx.vb:48
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
stBackEvent(String eventArgument) +57
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain() +1277



Any ideas what is causing this error???


Thanks in advance!!

Richard
 
H

Hermit Dave

are you by any chance using identity impersonation ? <identity
impersonate="true"/> you would probably find it in your config file.
plus have a look at Directory Security under web site properties in IIS
could be related to that... though not very sure...

worth a look
http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp

Hope this helps,

HD

PS: win2k3... lot more secure... you better look at the website config first

rrober07 said:
Thanks for the reply/..BUT
I Do have this login granted access to the public role for the database that
I want access to. I was able to access via local IIS machine (running
WindowXp) but I can't get it to work using remote IIS machine Windows2003
Server. (so I know that the SQL Server is working OK) It must be something
with the Web Server and IIS

any other Ideas...
Thanks!
Richard


Hermit Dave said:
well i actually dont know if all this things are required as such.

All you need to do is configure the devweb01/aspnet user to have atleast
public role in sql server.
Once you do that you can use trusted connection between the boxes.

The error message you are getting is because the devweb01/aspnet user doesnt
have access. dont think creating a local user on devsql01 with name aspnet
would help

chao

HD

rrober07 said:
Hello,

My Setup is I have a Web Server machine(Devweb01), Database SQL
Machine(Devsql01), a Client Machine(local machine) I have configured the
SQL machine as follows:
1) Added local Aspnet user account (with same password as aspnet user
on
IIS
(Devweb01))
2) edited local machine.config file <ProcessModel> Password attribute to
same password (both on IIS and SQL Machine)
3) SQL Server security is Sql Server and Windows
4) Create a sql login for aspnet user account and applied to local window
aspnet user account

I am getting the following error when I run my Web app:

Login failed for user '(null)'. Reason: Not associated with a trusted SQL
Server connection.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed
for
user
'(null)'. Reason: 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: Login failed for user '(null)'. Reason: Not associated
with
a
trusted SQL Server connection.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) in C:\Program Files\Microsoft Application
Blocks for .NET\Data
Access\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:142
LDSWebAuthorize.WebUsers.UserLoginValidate(String UserName, String
Password) in C:\Documents and Settings\richardr\My Documents\Visual Studio
Projects\LDSWebAuthorize\WebUsers.vb:261
WebAppJudah.Login.btnLogin_Click(Object sender, EventArgs e) in
\\devweb01\wwwroot$\Judah\TestSite\WebAppJudah\Login.aspx.vb:48
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
 
R

rrober07

Thanks again for the info and I have verified that I am not impersonating
and double checked the Directory Security and it is set to Windows
Integrated Authentication
I am using the Microsoft Data Application Block and looking at how that may
affect.

Thanks again for you help!! but unfortunately I am still trying to solve...

Hermit Dave said:
are you by any chance using identity impersonation ? <identity
impersonate="true"/> you would probably find it in your config file.
plus have a look at Directory Security under web site properties in IIS
could be related to that... though not very sure...

worth a look
http://msdn.microsoft.com/library/d...-us/cpguide/html/cpconaspnetimpersonation.asp

Hope this helps,

HD

PS: win2k3... lot more secure... you better look at the website config first

rrober07 said:
Thanks for the reply/..BUT
I Do have this login granted access to the public role for the database that
I want access to. I was able to access via local IIS machine (running
WindowXp) but I can't get it to work using remote IIS machine Windows2003
Server. (so I know that the SQL Server is working OK) It must be something
with the Web Server and IIS

any other Ideas...
Thanks!
Richard


configured
the
user
attribute
to
same password (both on IIS and SQL Machine)
3) SQL Server security is Sql Server and Windows
4) Create a sql login for aspnet user account and applied to local window
aspnet user account

I am getting the following error when I run my Web app:

Login failed for user '(null)'. Reason: Not associated with a
trusted
SQL
Server connection.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Login failed for
user
'(null)'. Reason: 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: Login failed for user '(null)'. Reason: Not
associated
with
a
trusted SQL Server connection.]
System.Data.SqlClient.ConnectionPool.GetConnection(Boolean&
isInTransaction) +474
System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnec
tionString options, Boolean& isInTransaction) +372
System.Data.SqlClient.SqlConnection.Open() +384
Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String
connectionString, CommandType commandType, String commandText,
SqlParameter[] commandParameters) in C:\Program Files\Microsoft
Application
Blocks for .NET\Data
Access\Code\VB\Microsoft.ApplicationBlocks.Data\SQLHelper.vb:142
LDSWebAuthorize.WebUsers.UserLoginValidate(String UserName, String
Password) in C:\Documents and Settings\richardr\My Documents\Visual Studio
Projects\LDSWebAuthorize\WebUsers.vb:261
WebAppJudah.Login.btnLogin_Click(Object sender, EventArgs e) in
\\devweb01\wwwroot$\Judah\TestSite\WebAppJudah\Login.aspx.vb:48
System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePo
postData)
+33
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top