Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login failed for user '(null)'.

Status
Not open for further replies.

AT76

Technical User
Apr 14, 2005
460
US
I'm trying to connect a ASP.NET app to SQL. However when I try to connect I get the following message:

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

I've tried conecting using the following connection strings:

string strConnSQL = "Server = " + m_strSQLServer +
";" + "Database = " + m_strDataSource + ";" + "Integrated Security=SSPI";

string strConnSQL = "Server = " + m_strSQLServer +
";" + "Database = " + m_strDataSource + ";" + "Trusted_Connection=Yes";

I have also checked the box for Integrated Windows Authentication and unchecked Anonymous Access (IIS).

Could someone help me figure out what I'm missing?

Thank you in advance!

- AT
 
I tried it again using both examples for an SQLConnection (.NET):

"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
- or -
"Server=Aron1;Database=pubs;Trusted_Connection=True;"

But I get the same error message. This is the first time I'm trying to connect thru ASP.NET. Is there any other setting I need to adjust in IIS?

Thank you!
 
BTW, I'm using: 1.1

I just found it…

In the Web.Config file I’ve added the following:

<identity impersonate="true" />

This did the trick!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top