I am very new to MVC 3 and I have problems with the Code First approach. I created 2 models, context, view, etc., and everything works fine (you can add, delete, etc.)
But when I check Microsoft SQL Management Studio, I see 2 databases. One of them is the one I asked in my web.config. It contains only a membership table
<connectionStrings> <add name="RecettesMaison" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=RecettesMaison;User Id=user;Password=password;" providerName="System.Data.SqlClient"/>
The second has a strange name: "RecettesMaison.DB.RecettesMaisonContext". This is the one that contains the generated table ...
I would like to know where this name comes from, and how I can do it, the entire generated table goes to my connection string with only the specified name. I just want one database. I am sure that this is only one tag somewhere in the context, but I can not find this information in google.
EDIT: In nutshel, I want my database to continue to use DropCreateDatabaseIfModelChanges<RecettesMaisonContext> , but I want it to create a database with the name specified in the connection string, which is wrong (It creates a name using the namespace and the name of the context of the database data)
Thanks!
source share