Connect to sql problem

Mar 26, 2011 at 1:15 PM

Hi there,

I am trying to build a new project ASP MVC 3. I want to use EF Code First as db link. I have the database outside the folder of the project. Is there an option to make it work? Somehow..provide sql connection and EF to know how to make connection with database?

Or how actualy works EF Coce? As I seen on a thread is good to know that name of the class has to be as the connection string name, right? Something else to consider?

Coordinator
Mar 30, 2011 at 8:15 AM

EF (Code First or not) will need a database connection string. You can attach an MDF file as an instance in SQL Server, but I highly recommend following the tutorial and using SQL Express w/ App_Data if possible. A large percentage of the questions here are due to setting up the database differently from how the tutorial specifies.