问候,
我正在尝试对SQLServerCompact进行私有部署。我正确地跟踪了所有的内容:http://erikej.blogspot.com/2012/05/private-deployment-of-sql-server.html,但仍然没有运气:
这让我说错了
包含基类System.Data.Common.DbConnection的汇编'System.Data、Version=2.0.0.0、Culture=neutral、PublicKeyToken=b77a5c561934e089‘所需的引用。在您的项目中添加一个。
我已经确认我已经在引用中添加了System.Data,实际上问题可能是由于私有文件夹中的System.Data.SqlServerCe.dll版本不正确所致。它是3.5.1.0 (如果我使用引用窗口中可用的)和3.5.1.50 (如果我使用私有dll)。
下面是我给出错误的代码之一。错误出现在SqlCeConnection中。
Imports System.Data.SqlServerCe
Imports System.Data
Imports System.IO
Module dbConnection
Public databaseConn As SqlCeConnection
Public Function openConn() As SqlCeConnection
If IsNothing(databaseConn) Then
ElseIf databaseConn.State = ConnectionState.Open Then
databaseConn.Close()
End If
databaseConn = New SqlCeConnection("Persist Security Info = False; Data Source=" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)) + "\sanyodb.sdf")
Try
databaseConn.Open()
Catch ex As Exception
MsgBox("Cannot open database", MsgBoxStyle.Critical + MsgBoxStyle.OkOnly, "Error")
End Try
Return databaseConn
End Function
Public conn As New SqlCeConnection("Persist Security Info = False; Data Source=" + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)) + "\sanyodb.sdf")
End Module这是一个智能设备项目,我使用VS 2008,CompactFrameworkv3.5进行开发。我使用的编码语言是VB.NET。
请指教我能做些什么?实际上,我想要处理的是在设备SD卡上部署我的应用程序,并确保它仍然工作,即使设备得到了硬重置。
谢谢!
你好,米洛
发布于 2014-02-25 20:24:24
博客文章不适用于Windows项目,正如文章开头所说的“操作系统必须是XP SP3或更高版本”。要使用Windows进行私有部署,请从正确的cab文件中提取所有必需的文件,并将它们作为内容包含在项目中
https://stackoverflow.com/questions/22025118
复制相似问题