Home

Error with SQL Server database in Visual Studio after using LINQPad

I have an SQL Server database which is being used for a MVC 4 project in VS 2010. I'm using LINQPad to run queries against my database. When I open LINQPad, I can connect to my .mdf database file and run queries as expected. When I close LINQPad, open up VS and try to view my database in server explorer the following error is shown:

"The database 'C:..... .MDF' cannot be opened because it is version 706. This server supports version 655 and earlier. A downgrade path is not supported. Could not open new database 'C:..... .MDF'. CREATE DATABASE is aborted. An attempt to attach an auto-named database file for 'C:..... .MDF' failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share."

I can drop the database and run the Seed() method via an Update-Database command from package manager as a workaround to the error, but it's a bit of a hassle to have to do it every time I connect to the database via LINQPad.

I've also tried it with VS2012 and I get the same problem. Has anyone experienced this before?

Comments

  • Are you sure that you use the same SQL servers? You could be using two different versions, e.g. SQL 2008 (655) and SQL 2012 Express (706)...
  • I'm 99% sure yes; if I had a working database in my solution, closed my solution, used Linqpad on the database in my solution, then closed Linqpad and reopened my solution (with same database) I would get the error as above. I've had to resort to using VS2012 to avoid getting the error.
Sign In or Register to comment.