VS2012 developer databases

Last updated: 2014-07-10

With VS2012 a new developer database installs.

The new connection string is in web.config

Data Source=(LocalDb)\v11.0;
Data Source=(LocalDb)\v11.0;

For EF and VS2012:

 <connectionStrings>
 <add name="MyEfEntities"
 connectionString="metadata=res://*/IL.MyEf.csdl|res://*/IL.MyEf.ssdl|res://*/IL.MyEf.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=(localdb)\v11.0;Initial Catalog=MyEf;Integrated Security=True;Pooling=False&quot;"
 providerName="System.Data.EntityClient" />
 </connectionStrings>

In VS2010 the Dev DB was SqlExpress. You can still use it from VS2012, if you need.

 <connectionStrings>
 <add name="MyEfEntities"
 connectionString="metadata=res://*/IL.MyEf.csdl|res://*/IL.MyEf.ssdl|res://*/IL.MyEf.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;Initial Catalog=MyEf;Integrated Security=True;MultipleActiveResultSets=True&quot;"
 providerName="System.Data.EntityClient" />
 </connectionStrings>

If you still need VS2010 installed you can probably do with only selecting Visual C# and Visual Web Developer as installation options.

Info

The instance name “(localdb)\v11.0” is a logical name mapped to a physical instance in a format like this: “MyPc\LOCALDB#6792664E”.

It will physically install the DB into the current logged in user: C:\Users\<username>\AppData\Local\Microsoft\Microsoft SQL Server Local DB.

It seems like this will enable each user using the PC to have its own sandbox of VisualStudio projects and databases. VS can then use the logical name “(localdb)\v11.0” for all users.

Uninstalling localdb

When you uninstall either

  • by running the installation file SqlLocalDB.MSI – choose remove or
  • from ControlPanel – Programs – “Microsoft SQL Server 2012 Express LocalDB”

then not all is removed. You also need to

  • delete the folder C:\Users\<username>\AppData\Local\Microsoft\Microsoft SQL Server Local DB
  • delete keys in HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\UserInstances
  • optionally delete keys in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Local DB\Shared Instances

 

The End.

One Comment

Add yours →

  1. In addition to (LocalDb)\v11.0 the newer versions are:
    (LocalDb)\MSSQLLocalDB
    (LocalDb)\ProjectsV12
    (LocalDb)\ProjectsV13

    And still you can install the old
    .\SQLEXPRESS

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: