Search code examples
.netsql-servervisual-studio-2013visual-studio-2017sqlconnection

Upgrading Database .mdf File Visual 2013 to 2017 SQL Compatible Connection Error?


The Data Source value in the connection string specifies an instance of SQL Server that is not installed. To resolve this issue, you can either choose to install the matching instance of SQL Server or modify the Data Source value in the connection string.

Visual Studio 2013 Database connection and 2017 connection seem to be running the same Microsoft SQL Connection Client, What's the compatibility differences and how do I Fix this?

Data Source: Microsoft SQL Server Database File (SqlClient)

New Connection String: C:\Users\Shawn\source\repos\Server\database\ClientRegit.mdf

Old connection String: Data Source=(LocalDB)\v11.0;AttachDbFilename="C:\Users\srhea_000\Documents\Visual Studio 2013\Projects\Server\database\ClientRegit.mdf";Integrated Security=True;Connect Timeout=30

These are the two instances of SQL that currently showing on my computer, I currently tried modifying the connection to Microsoft SQL Server as it was on VS2013 but as you can see in the connection string its was using V11.0 and 2017 has V13.0.4001 so I thought the database file would automatically upgrade for the new version of the instances SQL in VS2017, by attaching it when modifying the connection type

enter image description here

The instance of the server is not showing up in the modify connection applet, How come? I'm trying to upgrade but I can not assign an instance of the SQL Server in the connection modification.

enter image description here

This Shows that I attempted to modify the connection so the older version 2013 SQL database file was targeted for update for 2017, but it will not except its own connection string. enter image description here

This shows the error message I get when I try apply the connection string that attaches the database file to the new instance of SQL 2017 enter image description here


Solution

  • OK, Guys I figured out how to fix this problem, When programming in an older version of microsoft visual studio 2013, and then if you want to upgrade you need to have the prior program installed, I was orginally transferring the visual studio program from one computer to another that never had visual studio 2013 installed on it.

    So, I uninstalled the visual studio 2017, then installed visual studio 2013, made sure all the packages for the program existed on the new computer then installed the Visual 2017, it took all prior SQL instances and added to Visual 2017

    This fixed the problem Visual studio 2017 does not automatically upgrade your MDF File like its should, this could be a bug, it should be reported. so the SQL instance from visual studio 2013 is working on visual studio 2017, allowing me to run my prior program in the newer version. it also may allow the update as well.