I have created an ASP.NET MVC 4 project with Visual Studio 2010. I run the project, then open the Web Site Administration Tool, then add some roles and users. But somehow, I couldn't log in with a user that I have created via Web Site Administration Tool.
When I checked the web.config file, I saw a connection string that points to a database in the SQL Server Express, not the ASPNETDB.MDF under APP_DATA folder.
Question1: why VS created such database in the SQL Server Express, instead using ASPNETDB.MDF? I mean, what is the point (of Web Admin Tool then)?
Secondly, I've searched a connection string to use ASPNETDB.MDF, then come up with this one:
<add name="DefaultConnection" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|aspnetdb.mdf;User Instance=true" providerName="System.Data.SqlClient"/>
I deleted the previous connection string and add this one, but I still can not log in with a user that I created via Web Site Administration Tool.
Question2: How can I use ASPNETDB.MDF?
In my project, I don't want anonymous user to register; just pre-defined users can access to the web site. I may consider using the SQL Server Express database but I need to add users manually. In this case, user passwords are encyrpted with some algorithm and I don't know how to.
Finally, is it only me I don't know but I could't find exact problem on web. I'll be grateful for your help. Thank you.