2

A "friend" sent me an asp.net project. I've opened it in Visual Studio 2017. Everything seems fine, except that when I run it I get an error when it tries to use the internal database.

The offending line is:

GridBindingData data = RadGrid.GetBindingData("LinqToSql.NorthwindDataContext",
"Customers", startRowIndex, maximumRows, sortExpression, filterExpression.Replace("\\'", "'"));

which gives an error of:

System.Data.SqlClient.SqlException: 'The database 'C:\\APP_DATA\NORTHWND.MDF' cannot be opened because it is version 852. This server supports version 782 and earlier. A downgrade path is not supported.

Could not open new database

'C:\\APP_DATA\NORTHWND.MDF'. CREATE DATABASE is aborted.

An attempt to attach an auto-named database for file C:\\App_Data\NORTHWND.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.'

Now, from what I've researched this means that the project needs SQL server 2016, while I only have SQL server 2014. Ok, I downloaded SQL server 2016 express. Now I start the project, and still get the same error.

How do I configure either Visual Studio or my environment to get this project to use the correct version of SQL server?

GreySage
  • 995
  • 17
  • 38
  • I answered my own question like this. Maybe it will help you: https://stackoverflow.com/questions/51164180/sql-server-express-connection-to-mdf-file – IrishChieftain Mar 06 '20 at 18:33
  • Take a look at this https://stackoverflow.com/questions/3147172/change-sql-server-database-version – LinkedListT Mar 06 '20 at 18:37
  • @LinkedListT Right, I know I need a newer version of SQL server. My question is, now that I have that newer version, how do I use it? – GreySage Mar 06 '20 at 19:04
  • Somewhere in the application it'll have a connection string to connect to the database. I'd start by searching for NORTHWND in the solution and maybe checking the application settings etc. It should have a server name that'll need changing so perhaps if you find that you could post the connection string and what the instance name of your new SQL 2016 installation is. – PeterJ Mar 22 '20 at 12:03

0 Answers0