使用Visual Studio 2010添加assmbly引用SqlServerCe

编程入门 行业动态 更新时间:2024-10-28 10:23:48
本文介绍了使用Visual Studio 2010添加assmbly引用SqlServerCe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用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 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 Framework. so i have to add it manually in VS 2010 professional. how do i add it manually?

推荐答案

请参阅此处: msdn.microsoft/en-us/library/system.data.sqlserverce.sqlceconnection(v = VS.80)的.aspx [ ^ ] See here: msdn.microsoft/en-us/library/system.data.sqlserverce.sqlceconnection(v=vs.80).aspx[^] Quote:

命名空间:System.Data.SqlServerCe 汇编:System.Data.SqlServerCe(在system.data.sqlserverce.dll中)

Namespace: System.Data.SqlServerCe Assembly: System.Data.SqlServerCe (in system.data.sqlserverce.dll)

这里描述了如何添加引用:msdn.microsoft/en-us/library/wkze6zky(v=vs.80) .aspx [ ^ ]到一个组织。这个应该是第一类。

Here described is how you can add a reference: msdn.microsoft/en-us/library/wkze6zky(v=vs.80).aspx[^] to an assambly. This one should be in the first category.

我找到了另一种解决方案。 使用连接到sql数据库在Microsoft Visual Studio中使用C#,您必须手动添加sqlSeverCe名称引用。 即您单击Project>>>添加引用 弹出a窗口,单击浏览选项卡。 浏览到C:\Program Files \ Microsoft SQL Server Compact edition \v3.5 \Desktop 然后双击System .Data .SqlServerCe文件, 按OK。 i have found an alternative solution. To connect to the sql database using C# in Microsoft Visual studio,you have to amanually add the sqlSeverCe name reference manually. that is you click on Project>>>Add Reference a window pops up, click on the browse tab. browse to C:\Program Files\Microsoft SQL server Compact edition\v3.5\Desktop then double click on the System .Data .SqlServerCe file, press OK.

更多推荐

使用Visual Studio 2010添加assmbly引用SqlServerCe

本文发布于:2023-11-11 21:35:52,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1579615.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Studio   Visual   SqlServerCe   assmbly

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!