15

In vsexpress 2012 using asp.net. Made a login page. in that I am trying to enter user name and pass word I am getting the following error

The database 'C:\USERS\XYZ\DOCUMENTS\VISUAL STUDIO 2012\WEBSITES\WEBSITE4\APP_DATA\ASPNETDB.MDF' cannot be opened because it is version 706. This server supports version 663 and earlier. A downgrade path is not supported. Cannot open user default database. Login failed. Login failed for user 'MyName\MyName Ali'.

Please suggest how to fix this

Aaron Bertrand
  • 272,866
  • 37
  • 466
  • 490
Sohail
  • 780
  • 3
  • 14
  • 27

2 Answers2

22

Version 706 is a database file from Sql Server 2012
Version 663 is a database file from Sql Server 2008R2 (post SP1 ?)

So it seems that you are trying to open an MDF file made with 2012 but the current instance of Sql Server is 2008R2. There is no way to work with that file in this situation.

You could:

  • Upgrade the running instance of Sql Server to 2012
  • Export a script of your database file (data and structure) with 2008 compatibility, reimport your script on a 2008R2 instance and then distribute the MDF made from the 2008R2 instance
Steve
  • 213,761
  • 22
  • 232
  • 286
  • 1
    when i check my instance in management studio is Microsoft SQL Server 2012 (SP1) - 11.0.3128.0 (X64) Dec 28 2012 20:23:12 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows NT 6.2 (Build 9200: ) – Sohail May 20 '13 at 21:51
  • But your app connect to the same instance? What is the connection string stored in your web.config and used by your application? – Steve May 20 '13 at 21:57
4

Try to connect to server name "(localdb)\v11.0" check your web.config, it should mention the correct server instance used to create the MDF file

Imran Ali Khan
  • 8,469
  • 16
  • 52
  • 77
Jorre
  • 17,273
  • 32
  • 100
  • 145