tags:

views:

391

answers:

2

After installing the latest VS 2008 and SQL Server 2008 and buying the new Hanselman (plus others) book on ASP.Net MVC, went to create the NerdDinner solution. Didn't get real far as it won't let me create the database. It threw up this dialog that says "Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly.

I have the full SQL Server 2008 SP1 installed so I don't see a need to install SQL Express. Is there a different way to create and install a database in this solution if you are not using SQL Express?

+3  A: 

Check the App_Data folder. if it is empty then you need to select the menu [Project] then [ASP.NET Configuration] and that will create the DB.

If the file does exists and you still get the issue then try opening the file with SQL. If you can't, and I suspect you won't be able to, then you need to export the DB to a SQL Database.

Google the "Database Publishing Wizard" from Microsoft. This will allow you to take the SQLExpress DB and create a script for the whole Database including data. Run this on SQL Server and point your config to your new SQL Database.

Hope this helps.

griegs
That works like charm. Thanks
Yogendra
+1  A: 

You can just create the database/tables in Management Studio, use Server Explorer in Visual Studio to find it, and then drag tables from there into your Linq-to-SQL context. That's exactly what I did because I had the same problem as you.

mgroves