Add new Item -> SQL Server 2008 Database.mdf

.Net新手,仅作学习记录只用。

 

在VS2008中想要给项目添加基于服务的数据库文件,选择项目->AddItem->Data->Service-Based Database 之后会报出一个错误

"Connections to SQL Server files(.mdf) require SQL Server Express 2005 to function properly. Please verify the installation of the component ot download from the URL:...."。 

 

以下方案即可解决这个问题:

 

Attach the database files in SQL Server Management Studio, right-click the database name, choose Properties, then check Compatibility level in the Options tab.

If the Compatibility level of the newly created database files is "SQL Server 2005 (90)", I think maybe there are both SQL Server 2005 Express and SQL Server 2008 Express on your machine.

If so, please try to modify the SQL Server Instance Name in Visual Studio 2008.
Go to Tools -> Options -> Database Tools -> Database Connections, fill the SQL Server Instance Name with the name of SQL Server 2008 Express instance. Then create a new database in Visual Studio 2008 and check its version to confirm.

默认的VS2008的SQL Server Instance Name 是SQLEXPRESS,改成本机上SQL Server 2008的实例名称("SQLEXPRESS2008")就OK了。

 

你可能感兴趣的:(sql,.net,SQL Server,Go)