sql - Why does Entity keep making new databases? -


I am doing a project using the code-first approach of the unit framework until we have created the database By then the things had been cured:

  connectionString = "data source = (locali) \ projects v12; attachment debufflename = | data directory | schema.stem.mdf; integrated security = true; Connect timeout = 30 " 

and then we set DataDirectory :

  AppDomain.CurrentDomain.SetData (" Duda "Environment, GatefolderPath (Environmental Specific Folder. EpicataData) +" \\ TestDB \\ ");  

Now, there are several databases with our name, SCHEMA_TEST _ * , where * is a random number (I'm sure this Not random, but I did not know how this has happened). Apart from this, I am not sure what is happening due to the creation of any other database instead of being built earlier. Why is this creating another database, and why it is schema. Test can not be said as I had mentioned in connectionString

UPDATE

When I have a connection string Remove the attached debufflnem section, then it becomes normal, even then I do not make any difference. Although, valid, I still can not believe how additional databases have been created or why. However, it seems that there is a change in schema every time. Which should not be later, we are using migration. Try creating your connection string using a layout:

 
& lt; Add connection string = "server = yourServer; database = yourDB; integrated security = true" name = "default connection" PoviderName = "System.Data.SqlClient" />

Here is a link to a list with several examples of connection string:


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -