问题
When i am trying to run my website (with aspx) this problem comes up:
An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code
Additional information: The database 'C:\USERS\XXXX\DESKTOP\BERMAN\APP_DATA\DATABASE.MDF' cannot be opened because it is version 706. This server supports version 662 and earlier. A downgrade path is not supported.
Could not open new database 'C:\USERS\XXXX\DESKTOP\BERMAN\APP_DATA\DATABASE.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file C:\Users\XXXX\Desktop\Berman\app_data\DataBase.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
What to do?
回答1:
Looks like the Database.mdf file was created with a later version of SQL Server Express (2012) than the one installed on the server (2008). Upgrade the server with the latest version of SQL Server Express.
回答2:
If you’re trying to attach to a local db use LocalDb (since vs2012, sql2012), ie:
Data Source=(LocalDB)\v11.0;AttachDbFilename= (etc)
来源:https://stackoverflow.com/questions/19890891/cannot-be-opened-because-it-is-version-706-this-server-supports-version-662-and