I know how frustrating it is when getting this error while trying to run your application. The root cause of this error is normally due to versioning compatibility of your SQL Server (as what the error message provides succinct) while trying to attach the database file (.mdf).
Things to note: Version 612 is SQL Server 2005, Version 655 is SQL Server 2008, and 661 is SQL Server 2008 R2.
Here three points that you have to cofigure:
- Make sure that you have the appropiate SQL Server database instance installed on the machine. In this case I need to install SQL Server 2008 R2 (it could be the SQL EXPRESS one). If you do not have one, you then can install it from SQL Server 2008 R2 (the good thing is it is free). Please choose the appropiate processor (32/64 bits).
- Once you have the right SQL Server database instance then you need to set the default database instance to attach to in the Visual Studio. In this case I’m using Visual Studio 2010. Go to “Tools -> Options -> Database Tools -> Data Connections” and set the SQL Server Instance Name to the above (point #1) SQL Server instance you just installed.
- Change the connection string in your web.config as well
Up to this point you should be able to successfully run your application.
Happy fixing! :)