5

I'm using service-based database, so db file is stored with the program. It makes it easier for the end-user, when they can easily move the app with the db to another computer.

Here is my connection string for it:

add name="DBEnitity"
connectionString="metadata=res:///Model.csdl|res:///Model.ssdl|res://*/Model.msl;provider=System.Data.SqlClient;provider connection string="data source=SQLEXPRESS2008;attachdbfilename=|DataDirectory|\db.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />

But it won't connect if I test it on machine with a SQL Server Express 2012 installed. Why is that? Thanks!

1
  • 1
    does source=SQLEXPRESS2008 matter?
    – DJ Burb
    Mar 19, 2013 at 21:16

2 Answers 2

0

You should use data source=. to connect to a default instance of sql server, or data source=.\SQLSERVERNAME for sql server named instance

0

You should use:

data source=.

where . means local SQL server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.