0

I have a database in Visual Studio C# code. Whenever I try to connect the database with server, it says couldn't connect due to server version issue. I downloaded suggested version but it is displaying same error message.

Error message:

"The database 'C:\USERS\123435A\DESKTOP\TAST.NET\CANVAS\CANVA\APP_DATA\SD_ADCREATOR.MDF' cannot be opened because it is version 869. This server supports version 852 and earlier. A downgrade path is not supported. Could not open new database 'C:\USERS\123435A\DESKTOP\TAST.NET\CANVAS\CANVA\APP_DATA\SD_ADCREATOR.MDF'. CREATE DATABASE is aborted.

An attempt to attach an auto-named database for file C:\Users\123435a\Desktop\Tast.Net\Canvas\Canva\App_Data\sd_adCreator.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Hassan
  • 3
  • 3
  • 2
    MDF files are Sql Server files not MySql. – Steve Jun 28 '19 at 06:44
  • Some code would be awesome, because it looks like you are not connecting to a mysql database. Consider editing your question and adding the c# code you mention. – Cleptus Jun 28 '19 at 07:02
  • 1
    SQL Server internal version numbers: 869 is SQL Server 2017. 852 is SQL Server 2016. You are trying to add a SQL Server 2017 database in a SQL Server 2016 and that is not supported. Consider either upgrading your 2016 to a 2017 or converting the database into a 2016 compatible one. I would advice the former. – Cleptus Jun 28 '19 at 07:07
  • Hi Steve! Thank you for your kind concern . I don't have "SQL SERVER 2016". I am trying to connect my database on "SQL SEVER 2014" and "SQL SEVER 2017" but same error message is displaying for both servers. NOW what i should do ? – Hassan Jun 28 '19 at 09:42
  • @Hassan, you will not get the same error message on different versions; the "server supports version" number will be different for each different version when you try to attach the SQL 2017 database an earlier SQL Server version. You probably have multiple SQL Server instances installed with different versions. Maybe adding the connection string to your questions will help. – Dan Guzman Jun 28 '19 at 10:31
  • strange, the error message says you are trying to put a 2017 database in a 2016 server... But you say your database server is not 2016. Could you connect to your database server and execute `SELECT @@version`??? – Cleptus Jun 28 '19 at 12:15
  • Possible duplicate (same problem just database version change) of [The database cannot be opened because it is version 782. This server supports version 706 and earlier. A downgrade path is not supported](https://stackoverflow.com/questions/26346647/the-database-cannot-be-opened-because-it-is-version-782-this-server-supports-ve) – Cleptus Jun 28 '19 at 12:19
  • Hi @DanGuzman thank you for your kind concern. Here it is My connection string – Hassan Jun 28 '19 at 17:24
  • Hi @DanGuzman i have uninstalled all other version of sql server but still same error... – Hassan Jun 28 '19 at 18:28
  • The connection string specifies the default SQL instance. What does query `SELECT @@VERSION` return? What output do you get from running this command from a command prompt:`sqllocaldb info` – Dan Guzman Jun 28 '19 at 21:02
  • I run that command and it says: 'sqllocaldb' is not recognized as an internal or external command, operable program or batch file. – Hassan Jun 29 '19 at 10:32
  • SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) – Hassan Jul 01 '19 at 15:05

0 Answers0