3

I'm learning MVC3 by covering the famous MusicStore tutorial http://mvcmusicstore.codeplex.com/ The connection string used for EF code first is :

<connectionStrings>
    <add name="MusicStoreEntities"
    connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf"
    providerName="System.Data.SqlServerCe.4.0"/>
</connectionStrings>

I would like to use my localhost SQL Server database (windows authentication) instead. What would be the connection string for it to keep working correctly ? Thanks,

2 Answers 2

3

Assuming your DB name is MusicStore:

ConnectionString="Data Source=(local); Initial Catalog=MusicStore; Integrated Security=True;"
Provider="System.Data.SqlClient"
Sign up to request clarification or add additional context in comments.

Comments

1

Here:

<add name="MusicStoreEntities" connectionString="DATA SOURCE =(Your Server Name); INITIAL CATALOG =MusicStore;Integrated Security=True;" providerName="System.Data.SqlClient"/>

and have a look on

Connection strings for SQL Server 2008

Regards

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.