Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sql local database cannot be opened

I recently installed VS2015 Update 2 on two different PC, one at home and one at work, with the same installer file.

Now if I open a project with Sql LocalDB on my own PC, I obtain this error:

The database 'M:\PROJECTS\BLOG\APP_DATA\myBlog.MDF' cannot be opened because it is version 851. This server supports version 782 and earlier. A downgrade path is not supported.

I cannot retrieve information about this 851 version (maybe Sql LocalDB 2016?). I'm sure to have Sql LocalDB 2016 RC0 on both PCs, and I verifies the settings in both VS2015 is:

(LocalDB)\MSSQLLocalDB

Does anyone know how to fix this?

like image 854
Rotondof Avatar asked Apr 18 '16 16:04

Rotondof


1 Answers

I had the same problem recently, I installed VS2015 Update 2, the same as your environment. Microsoft install MSSQL 2016 RC0 in this update... so there are two or more versions of LocalDB on your computer.

This problem is caused by having different versions of SqlLocalDB on your computers. You can solve this problem by changing the version of SqlLocalDB on one of your computers.

For example, change to version 851 (13.0)

  1. Open CMD , cd to folder of SqlLocalDB (Default : "C:\Program Files\Microsoft SQL Server\130\LocalDB\Binn")
  2. Command "SqlLocalDB.exe delete "MSSQLLocalDB"" , The instance of LocalDB will be deleted.
  3. Command "SqlLocalDB.exe create "MSSQLLocalDB"" , Then you'll see the instance of newest LocalDB version in your computer has been created.

How to use SqlLocalDB : https://msdn.microsoft.com/zh-tw/library/hh212961%28v=sql.120%29.aspx

Good luck!

like image 163
Kevin Avatar answered Oct 17 '22 11:10

Kevin