0

I am using LocalDB for development testing of my C# / MSSQL application. I use VS 2013 generally and on this machine LocalDB is listed as (localdb)\ProjectsV12.

However I also sometimes work on a laptop running VS2015 Community edition. I've just discovered that from this version of VS, Local DB is referred to as either (localdb)\ProjectsV13 or (localdb)\MSSQLLocalDB (I don't know why both).

Is there a way I can avoid having multiple connection strings, is there one generic way to define a connection string for LocalDB regardless of version?

Mr. Boy
  • 60,845
  • 93
  • 320
  • 589
  • 1
    Dupe of http://stackoverflow.com/questions/27197359/localdb-sql-server-2014-express-creates-2-instances-localdb-projectsv12-loc/27201328#27201328 ? – ErikEJ Jul 26 '16 at 15:12
  • It explains what they mean but doesn't actually answer my question... if developers are using 2013 and 2015 how can I make the same code work on both? Do I need per-version config files somehow? – Mr. Boy Jul 26 '16 at 15:14
  • Actually it *does* answer the question - *don't* use the project-specific instances, these are used by SSDT. Just like your application wants to use its own LocalDB instance, SSDT is using its own instance. ErikEJ mentions in the comments that developers should use `MSSQLLocalDB` or `v11.0` depending on the SQL Server version installed – Panagiotis Kanavos Jul 26 '16 at 15:16
  • That's still not the question. If some developers are using 2013 and others 2015 then some will need to use MSSQLLocalDB and others v11.0 - so my question stands how to address this. – Mr. Boy Jul 26 '16 at 15:22
  • Looks like you need this, then: https://github.com/martincostello/sqllocaldb – ErikEJ Jul 26 '16 at 15:27
  • I'm having same issue with the difference that some people in my team are using VS 2013 which defaults to localdb version 2014(12.0) while some are using VS 2015 where default is localdb version 2016(13.0). For local development, we check in the database mdf files. now the mdf files checked in with 2016 doesn't work with 2014 as they get upgraded. We are using "MSSqlLocalDB" in the connection string. – Bimal Aug 23 '16 at 10:12

0 Answers0