I have IIS installed on a Windows XP Pro machine and am using MS Visual Web Developer Express (VWDEx) and SQL Server Express (SQLSEx) to try and create a website.
I used menu item: Website > ASP.NET Configuration to enable roles and create a role called 'Administrators'. I then created a user called 'webmaster' of type 'Administrators' role.
On one of the web pages I have used the inbuilt VWDEx Login control from the toolbox and updated web.config as:
<location path="CatalogAdmin.aspx">
<system.web>
<authorization>
<allow roles="Administrators"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<system.web>
<authorization>
<allow roles="Administrators" />
</authorization>
When I run the website to test it (within VWDEx) and try to login, it gives me the following error:
Cannot open user default database. Login failed.
Login failed for user 'GLKD2396800\ASPNET'.
…
Exception Details: System.Data.SqlClient.SqlException: Cannot open user default database. Login failed.
Login failed for user 'MyMachineName\ASPNET'.
…
Stack Trace:
[SqlException (0x80131904): Cannot open user default database. Login failed.
Login failed for user 'GLKD2396800\ASPNET'.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +734867
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning… etc… etc… etc…
Any ideas on how to solve this problem ?
Thanks
That means the 'GLKD2396800\ASPNET' windows user is not a valid login or does not have the appropriate permissions within it's default database on the SQL Server. You'll have to first ensure this user is a valid server login...to do that, see the following command's information in Books Online:
CREATE LOGIN...
Once it's a valid login, you'll have to give it the appropriate permission(s) in the appropriate database(s) on the server to allow it to login to those db's...for more information on this, see the following command's information in Books Online:
CREATE USER....
HTH,
No comments:
Post a Comment