Home » ASP.NET » The database…cannot be opened because it is version … This server supports version … and earlier

The database…cannot be opened because it is version … This server supports version … and earlier

I am using Visual Studio 2015 and I have installed all available updates, including the SQL updates;
I copied a project of web application using database from one developement environement to another computer.
I run the project on the second environement and I receive following message:

The database…cannot be opened because it is version 856. This server supports version 782 and earlier. A downgrade path is not supported. Could not open new database…. CREATE DATABASE is aborted. An attempt to attach and auto-named database for file…failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Solution

Use Command Prompt:

>SQLlocalDB
it will display using version of tools and help.

Microsoft (R) SQL Server Express LocalDB Command Line Tool
Version 13.0.1601.5
Copyright (c) Microsoft Corporation.  All rights reserved.

Usage: SqlLocalDB operation [parameters…]

I have on my new environement two versions of SQL Server and the version v.12.0 was running by default as (localdb).
To change it:
These commands will stop and delete current (localdb) instance using SQL Server version v.12.0 (SQL Server 2014 using 782)

>sqllocaldb stop
>sqllocaldb delete
New start command will initialise localdb with the latest installed SQL Server version (in my case version v.13.0 = SQL Server 2016 using 856)
>sqllocaldb start

About

Informatics - my job & my passion.