Which connectionstring to use in EF Code-first with an existing database
The existing database was created in the project itself and resides on App_Data as prompted by visual studio while adding a new sql database item to the project.
So, should i use t开发者_如何学Chis string :
data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\Database.mdf;User Instance=true"
Or this one
Data Source=.\SQLEXPRESS;Database=Database22;Integrated Security=SSPI;
I am not following why you should use those connection strings with EF. Take a look at this: How to: Build an EntityConnection Connection String
精彩评论