This was weird & probably first problem I faced related to Sql Server version(s). I was trying to learn Asp MVC with the help of sample application MvcMusicStore. I open it in VS 2010 and debug. On debugging it throw runtime exception:
The reason for exception was that MvcMusicStore application’s database files (.mdf) were created with Sql Server 2008 (version 655). While the application was trying to attach database file with Sql Server 2005 (version 611) instance. And since there is compatibility issues in these two versions so the exception was raised.
- Upgrade Sql Server 2005 to Sql Server 2008 and create same database files in Sql Server 2008 (as Sql Server 2008 adds metadata to the resulting .mdf files).
- Or you can install fresh version of Sql Server 2008 along with Sql Server 2005. BUT since you are (now) having two versions of Sql Server you would need to modify DataSource in connectionString with SqlServer 2008 instance name (.\VSS is instance name I created for… it could be any except sa as it is already there in system)in web.config as follows:
Category: Error and Solution