我可以使用 Sql Server CE (3.0) 作为 Windows 应用程序的嵌入式数据库吗?我必须在机器上安装 Sql Server CE 吗?
我创建了一个 Windows 应用程序,并且需要一个数据库。我首先在其中使用SQL Server Express
版本。然后我才知道它不完全是一个可移植数据库。也就是说,SQL Server Express 版本应该已经安装在我打算使用我的应用程序的计算机上。我发现我可以使用 SQL CE 来代替并更改为它。我发现我所要做的就是将 sqlceme30.dll 复制到应用程序中。在我的开发系统中运行良好。但是,当我将应用程序复制到另一个系统并打开该应用程序时,它会抛出错误
System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Can I use SQL CE in my application?我真的不想将它安装在我使用我的应用程序的所有机器上。或者如果没有,我可以使用哪些其他数据库而无需安装?使用权?
I created a windows application and I needed a database for it. I first used SQL Server Express
edition in it. Then I came to know that it is not exactly a portable database. That is, SQL Server Express edition should be already installed in the computer where I suppose to use my application. I came to know that I can use SQL CE instead and changed to it. I found somewhere that all I have to do is just copy the sqlceme30.dll
in the application. Worked fine in my developement system. But when I copy the application to another system and open the application, it throws the error
System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlServerCe, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
Can I use SQL CE in my application? I really don't want to install it in all the machines I use my app. Or if not, which other db I can use without intalling? Access?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您的引用设置为
复制本地
。右键单击引用,然后单击属性。他们将Copy Local
属性更改为true
。这将确保 dll 包含在发布中。Ensure your reference is set to
Copy Local
. Right click on the reference, and click properties. They change theCopy Local
property totrue
. That will ensure that the dll is included in the publish.