why I can't create SQL database in VS 2010?

2019-09-13 02:41发布

问题:

I want to create a SQL Server database in App_Data folder, but alert pops up saying:

Connections to SQL server database files (.mdf) require SQL Server 2005 Express or SQL Server 2008 Express to be installed and runnin on the local computer

But I have this installed:

What's wrong with that? I need help:/

回答1:

You need the SQL Server Express, not the normal (non-express) one.

Quoting this thread on MSDN social:

In particular, SSE has a number of options turned on that are typically not on in higher versions of SQL Server. You could turn them on but wouldn't want to if you are using SQL Server as a general server, not a local database store. In addition, there is some behavior that is unique to SSE that is particular to the way local database stores are used. But, to be quite clear, it is exactly the same .exe.

Have a look at this SO thread, too: Problem with creating .MDF file from Visual Studio 2010