Visual Studio Website: Can't create an SQL Database!
I'm using Visual Studio 2008 SP1 with SQL Server 2008.
I'am trying t开发者_如何学Goo add an SQL Server File (MDF) in my Website project. Then I get the following error:
Connections to SQL Server files (*.mdf) require SQL Server Express 2005 to function properly. Please verify...
I've been using Google without any results, and I'm in deep need for help..
I've tried the following things to fix it, without succes:
Changing instance names so they should fit
Attaching the database in the management studio
Uninstall/Install Visual Studio
Uinstall/Install SQL Server 2005 AND 2008
All in all, this is a REALLY annoying error and it just should work..
Adding an .MDF to your VS project requires a SQL Server EXPRESS edition - only those are able to attach a .mdf file from the App_Data
directory.
The full versions (Developer, Web, Standard, Enterprise) of SQL Server cannot use the AttachDbFilename=|DataDirectory|mydbfile.mdf;
feature that is the basis of this feature in Visual Studio.
If you have a full SQL Server edition on your machine (or on a server), you need to use that SQL Server in a more traditional way: use SQL Server Management Studio (or the Server Explorer inside Visual Studio) to create databases and database objects like tables, and connect to them using a classic ADO.NET connection string (server=name;database=name;...
)
精彩评论