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? Commented 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

Sign up to request clarification or add additional context in comments.

Comments

0

You should use:

data source=.

where . means local SQL server.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.