c# - The path is not valid. Check the directory for the database. [Path = (Localdb)\v11.0] -
I am working on an MVC web application using SQL Server and entity framework (first timer). I get lots of forms that add stuff to the data table and this type of use (localBD) \ v11.0 and I know that there is data
my next step on which I am currently I'm adding the login / register function I'm adding
try {WebSecurity.InitializeDatabaseConnection ("DefaultConnection", "UserProfile", "UserId", "UserName", AutoCreateTables : True); } Hold (exception e) {Console.Write (e); }
In my Global.asax.cs file in the application_Start method
is my default connection
And, of course, is set in my web.config.
Now when I step through the code, it throws an exception that there is no database (Localdb) \ v11.0
Maybe some of the buses I see I'm not as good as your good friend Google can get through.
Your connection string for LocalDb should look something like this (assuming that the MDF file inside your solution The app_data folder contains:
& lt; add name = "DefaultConnection" connectionString = "data source = (locali) \ v11.0; AttachDBFilename = | data directory | \ filename.mdf" providerName = "System.Data.SqlClient" />
Comments
Post a Comment