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 Mike Lewis 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 'PC\ASPNET'.

Status
Not open for further replies.

shaunk

Programmer
Aug 20, 2001
402
AU
I am runnng ASP.Net 2.0 on IIS 5.1 on my development PC.
I have configured Users/Roles/Access rules through the ASP.Net configuration tool in VWD Express 2005.

On entering credentials in the login control, I am receivng the old error:
'Exception Details: System.Data.SqlClient.SqlException: Login failed for user 'PC\ASPNET'.'

I understand that this is a very common problem. I don't have a connection string setup in web.config of the website.

I understand, if you don't configure it otherwise,that the membership system uses the default 'LocalSQLServer' connection string, which is by default set in Machine.config as follows:
Code:
 <connectionStrings>
        <add name="LocalSqlServer" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
    </connectionStrings>

OK. It is using a trusted connection to access the membership database ASPNETDB. This database is by default setup in the App_Data directory of the website.(How and why I don't know - it is created at certain point in configuring security under ASP.Net configuration.
). And because the login failed for PC/ASPNET, it is obvious that the account it is using to connect is the ASP.Net User account - ASPNET.

1. Where is ASP.Net configured to use that account to try and connect.
2. Why doesn't it have access to \App_Data\ASPNETDB.mdf by default. This seems crazy.
3. How do I grant ASPNET access to an mdf file sitting in \App_Data.

Confused

Thanks




The risk with keeping an open mind is having your brains fall out.
Shaunk

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top