0

I am using Windows 8.1 64 bit, Visual Studio 2012 and SQL Server 2012. When I try to add a SQL Server database to the mvc solution in Visual Studio, it gives me following error:

Connection to sql server database files require sql server 2005 express or sql server 2008 asp net

Any thoughts?

John Saunders
  • 157,405
  • 24
  • 229
  • 388
Ivancao
  • 11
  • 7
  • 1
    Because you don't connect to database. You creating **database file**, which is part of the project. And for that you need Express version. – T.S. Dec 18 '14 at 03:30
  • @T.S. Thanks. But why do I need express version if I already have the regular version? – Ivancao Dec 18 '14 at 03:36
  • Again. You said *When I try to add a SQL Server Database to the mvc solution* - you're adding db file to your project. DB file is different beast. Full version of Sql Server doesn't work with it. Check this out http://stackoverflow.com/questions/5446316/code-first-vs-model-database-first – T.S. Dec 18 '14 at 04:17
  • 1
    The ability to have "free-floating" `.mdf` that you connect to using `AttachDbFileName=......` in your connection string in an **Express-only** feature. The **proper solution** is to create the database **on the SQL Server** and reference it only using it's logical name and stop fiddling around with `.mdf` files - let SQL SErver handle that .... – marc_s Dec 18 '14 at 05:55
  • Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on [so]. See "[Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts). – John Saunders Dec 18 '14 at 05:57

1 Answers1

1

On 64-bit systems this error can be caused by 32/64 bit mismatch between Visual Studio and SQL Server Express. Microsoft published a fix regarding this issue, hope it helps:

http://support.microsoft.com/kb/957944