Visual Studio 2012中的SQL Server CE问题 [英] SQL Server CE Issues in Visual Studio 2012
问题描述
对于为什么我在Visual Studio 2012中执行程序时,我的SQL Server CE本地实例为什么会不断失去连接,所以有人对它有任何建议吗?当我在设计器中或代码隐藏环境中工作时,它已连接,但是当我执行程序运行它时,在数据库实例旁边看到一个红色的X.
Does anyone have any advice on why when I execute a program in Visual Studio 2012 my SQL Server CE local instance keeps losing connection? It''s connected while I''m working in designer or code-behind, but when I execute the program to run it, I see a red X next to the database instance.
推荐答案
抬起头,我开始使用它.
在VS2012 Add Reference上,您必须浏览并寻找;
Heads up, I got it working.
On VS2012 Add Reference, you have to browse and look for;
C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Desktop
,然后选择
System.Data.SqlServerCe.dll
注意,以上内容适用于SQLCE 4.0.以下是更多详细信息.
将其导入您的项目中,您就可以开始了.只要确保您正在为所使用的数据库导入正确的版本即可.
SQLCE 4.0
Note, the above was for SQLCE 4.0. More details below.
Import it on your project and you''re good to go. Just make sure you''re importing the right version for the database you are using.
SQLCE 4.0
C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0\Desktop
SQLCE 3.5
SQLCE 3.5
C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v3.5\Desktop
与此相同.即使在我导入System.Data.SqlServerCe之后,sqlceconnection,sqlcecommand和其他命令也不可用.
Same here. Even after I do Imports System.Data.SqlServerCe, sqlceconnection, sqlcecommand and others are not available.
这篇关于Visual Studio 2012中的SQL Server CE问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!