Pankaj Upadhyay
Pankaj Upadhyay

Reputation: 13594

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 this 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;

Upvotes: 0

Views: 276

Answers (1)

RKh
RKh

Reputation: 14161

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

Upvotes: 1

Related Questions