T
Tony Johansson
Hello!
Here is some background information:
I use windows XP pro with a Sql Server express 2005 database with Sql Server
Management Studio Express
I use VisualStudio(VS) 2005
I use a file system web site that is using the built in Development Web
server.
I have two aspx files one to use when logging in and the other to redirect
to when I have been successully authenticated
I have implemented forms authentication by using ASP.NET Web Site
Administration Tool which
create an ASPNETDB.MDF and a web.config file
This Web.config file look like this after having been edited
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>
<allow users="John" />
<deny users="?" />
</authorization>
<authentication mode="Forms">
<forms loginUrl="LoginForm.aspx" timeout="5" cookieless="AutoDetect"
protection="All" />
</authentication>
</system.web>
</configuration>
So If I run the web application from VisualStudio 2005 everything works
fine.
If I now start Internet explorer and enter this url
http://localhost/Northwind/customerdata.aspx
the login form is displayed. I enter my crededentials(userName,password) and
then this error occur
Cannot open user default database. Login failed.
Login failed for user 'HEMPC\ASPNET'.
I have used Sql Server Management Studio Express to attach to the database
located at F:\NORTHWIND\APP_DATA\ASPNETDB.MDF and
found that everything seems to be right in the ASPNETDB database.
For example user guest is defined so ASPNET can use this user.
I know this because in another data named Northwind I don't have user ASPNET
defined because user guest is used by ASPNET.
Some information concerning login control and SQL Server express that I have
found claim that there is a bug when
having error like Cannot open user default database. Login failed.
Login failed for user 'HEMPC\ASPNET'.
Does anybody have some kind information that give a solution to my problem
why I can't
use IIS and forms authentication when having the database ASPNETDB.MDF ?
//Tony
Here is some background information:
I use windows XP pro with a Sql Server express 2005 database with Sql Server
Management Studio Express
I use VisualStudio(VS) 2005
I use a file system web site that is using the built in Development Web
server.
I have two aspx files one to use when logging in and the other to redirect
to when I have been successully authenticated
I have implemented forms authentication by using ASP.NET Web Site
Administration Tool which
create an ASPNETDB.MDF and a web.config file
This Web.config file look like this after having been edited
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authorization>
<allow users="John" />
<deny users="?" />
</authorization>
<authentication mode="Forms">
<forms loginUrl="LoginForm.aspx" timeout="5" cookieless="AutoDetect"
protection="All" />
</authentication>
</system.web>
</configuration>
So If I run the web application from VisualStudio 2005 everything works
fine.
If I now start Internet explorer and enter this url
http://localhost/Northwind/customerdata.aspx
the login form is displayed. I enter my crededentials(userName,password) and
then this error occur
Cannot open user default database. Login failed.
Login failed for user 'HEMPC\ASPNET'.
I have used Sql Server Management Studio Express to attach to the database
located at F:\NORTHWIND\APP_DATA\ASPNETDB.MDF and
found that everything seems to be right in the ASPNETDB database.
For example user guest is defined so ASPNET can use this user.
I know this because in another data named Northwind I don't have user ASPNET
defined because user guest is used by ASPNET.
Some information concerning login control and SQL Server express that I have
found claim that there is a bug when
having error like Cannot open user default database. Login failed.
Login failed for user 'HEMPC\ASPNET'.
Does anybody have some kind information that give a solution to my problem
why I can't
use IIS and forms authentication when having the database ASPNETDB.MDF ?
//Tony