1

我必须编写一个 Windows 窗体应用程序,它将在装有 Windows 7 的平板电脑上运行。

此应用程序将处理与我们的中央 ERP 没有连接的仓库的库存盘点。用户将扫描条形码标签,应用程序必须将数据保存在本地。

在操作结束时,用户将能够通过 LAN 将数据上传到我们的 ERP 表中。

因此我的问题是将扫描的数据保存在本地的最佳方法是什么?

选项 1:简单文本文件(自定义 txt 或 XML)

选项 2:SQL Server 精简版?

选项3:???

我不太喜欢文本文件的想法,因为我必须每隔 30-40 秒打开和关闭它们,用户将扫描标签。SQL Compact 是最好的选择吗?

4

2 回答 2

1

是的。只需确保在每个可以执行更新的表中存储设备 ID。然后,当它们通过合并复制同步回共享 SQL Server 时,任何条目都不会发生冲突。

于 2012-11-29T20:59:19.743 回答
1

If you are only storing something simple like a SKU and quantity, and not modifying/replacing values, a text file will be extremely fast and simple. You can open a text file for append and just add lines on the end, then close the file. You could also use XML and serialization, but if there are just a couple of values then a plain text file format would be simplest and serialization will add development labor and has more potential for performance issues, deserializing, updating, then reserializing the object back to disk over and over.

A DB might be necessary if you want to have relational data, or if somehow multiple users/devices could access simultaneously, or if you need rowset operations for data modification. If you use any db it will also access the file system every time there is a new row, same as using a file.

于 2012-11-29T21:07:21.143 回答