嵌入式(内存中)数据库或独立数据库
我将构建一个 C# WPF 应用程序,该应用程序会在数小时内获取 USB/RS232 数据(~ 速率:10 毫秒),并且必须将所有这些数据存储到数据库中。用户可以将所有RS232数据和设置数据(例如文本框)保存到数据库中,也可以将它们输出到文件中。一旦他们将所有数据输出到文件中,数据库中相应的数据就会被删除。用户稍后可以导入(或打开)该文件并将其加载到应用程序中,其所有数据将显示在显示屏上并再次存储回数据库。我正在寻找嵌入式数据库解决方案,用户不需要单独安装数据库服务器。
嵌入式(内存中)数据库(例如 SQLite)可以完成这样的工作吗?
I will build an C# WPF application that intakes USB/RS232 data (~ rate: 10ms) for hours and have to store all these data to a database. User can save all the RS232 data and setting data (e.g. TextBoxes) to a database and also output them to a file. Once they output all the data to a file, the corresponding data in the database will be erased. The user can later, import (or open), the file and load it into the application, and all its data will shown on the display and store back to the database again. I am looking for embedded database solution where user does not need to install a database server separately.
Can embedded (in memory) database, such as SQLite, accomplish such a job?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,SQLite 可以做到这一点 - 有几点适合您的情况:
:memory:
作为连接字符串上的数据源。Yes SQLite can do this - there are a couple of points specific to your situations:
:memory:
as the data source on your connection string.为什么不呢?现在有带有 Visual Studio 2010 的 SQL Compact Edition 4。
Why not? There is now SQL Compact Edition 4 with Visual Studio 2010.
SQLite 不需要安装数据库服务器。它还可以在内存中操作: http://www.sqlite.org/inmemorydb.html
有关将 C# 与 SQLite 结合使用的信息,请参阅:是否有 .NET/C# SQLite 的包装器?
SQLite does not require installation of a database server. It can also operate in-memory: http://www.sqlite.org/inmemorydb.html
For using C# with SQLite, see: Is there a .NET/C# wrapper for SQLite?
SQLite不需要任何安装,但是根据SQLite进行开发比较麻烦。
例如,即使上面的语句也会出错。
SQLite doesnot require any installation but developing according to SQLite is cumbersome.
For example, even above statement gives error.