简体   繁体   中英

Cannot connect to the database

I have created a database in App_Data and I want to use this file in my project.

In the toolbar I grabbed the sqlDatasource . I clicked on Configure data source . I chose Microsoft SQL Server database file and said continue. I browsed for the file. I chose it then I clicked ok. The following error occurred:

I says the database myweb.mdf cannot be opened because it is version 661 and the server version is 662 and earlier: create database is aborted. The attempt to attached an auto-named database for the \\app-data\\myweb.mdf failed. A database with the same name exists or specified file cannot be opened or it is located on UNC share.

Sounds like you've upgraded to SQL Server 2008 R2 Whilst the database was created in SQL Server 2008, seems you need to upgrade the database using the database migration wizard

see this answer for a similar problem

Check this: SQL Server: Attach incorrect version 661

You'll have to either upgrade your 2008 SP2 instance to R2, or you have to copy out the data in that database into an 2008 database (eg using the data migration wizard, or something equivalent).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM