It's not Visual studio that's the problem: it's the version of SQL that teh DB file was created with.
Open SSMS, and open a new query window.
Enter the query:
DBCC CHECKPRIMARYFILE('PathToDataBaseFile',2)
And execute it. For example:
DBCC CHECKPRIMARYFILE('D:\Database Backups\SM_XRVCB.mdf',2)
The response you get includes the version number:
property value
Database name SM_XRVCB
Database version 706
Collation 53256
In this case, the file was created with V706, which is SQL Server 2012:
SQL Server Version Internal Database Version
SQL Server 2016 852
SQL Server 2014 782
SQL Server 2012 706
SQL Server 2008 R2 660/661
SQL Server 2008 655
SQL Server 2005 611/612
SQL Server 2000 539
SQL Server 7 515
So if your error is saying V782, then it's SQL Server 2014, and the version number of the DB file cannot be higher than 782.
Then look at the instance you are connecting to (look at the connection string your code is using) and find out what version of SQL that server is (that's simple,
SELECT @@VERSION
will do it!). You need to point that connection string at the right server: I.e. 2016 or later in order to open the file.