I have an MVC 4
application that uses Entity-Framework
and SQL Express 2008
, and i want to use the same database also for membership and roles. my connection string is:
<add name="AuthTestDbEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=.\sqlexpress;initial catalog=AuthTestDb;user id=sa;password=1234;pooling=False;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
and so i added another connection string for the membership:
<add name="DefaultConnection" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=AuthTestDb;user id=sa;password=1234;Integrated Security=True" providerName="System.Data.SqlClient"/>
and i ran the aspnet_regsql.exe
command so it added the necessary tables to my database.
However, if I add a new user using the ASP.NET configuration
tool I cannot log in with that user and i can't find him in my database. If i create a new user using the register action i can log in with it but it creates a new database in my App_Data
folder called ASPNETDB.MDF
.
What do i need to do so that i'll be able to use the same DB for my website?