问题描述
我正在尝试使用C#连接数据库。在Visual Studio 2010中。
这是代码设置SqlServerCe连接变量
I am trying to connect a database using C# . in a visual studio 2010.
this is the code To set up a SqlServerCe connection variable
System.Data.SqlServerCe.SqlCeConnection con; // outside the form load
con = new System .Data .SqlServerCe.sqlCeConnection(); //inside the form load
I得到一个错误说:
I get an error saying:
sqlServerCe does not exist in the namespace.
我所知道的是我需要添加程序集引用。我怎么做?
请帮忙。
注意:
此程序集(SqlServerCe)是SQL Server Compact Edition的一部分,而不是Microsoft .net Framework的一部分。所以我必须在VS 2010专业版中手动添加它。如何手动添加?
What I know is that i need to add an assembly reference. How do i do that?
please help.
NB:
this assembly (SqlServerCe) is part of SQL Server Compact Edition and not part of Microsoft .net Framework. so i have to add it manually in VS 2010 professional. how do i add it manually?
推荐答案
命名空间:System.Data.SqlServerCe
汇编:System.Data.SqlServerCe(在system.data.sqlserverce.dll中)
Namespace: System.Data.SqlServerCe
Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)
这里描述了如何添加引用: []到一个组织。这个应该是第一类。
Here described is how you can add a reference: http://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.80).aspx[^] to an assambly. This one should be in the first category.
这篇关于使用Visual Studio 2010添加assmbly引用SqlServerCe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!