Visual C# 2008数据库应用实例
我只有几周的时间使用 vc# (2008) 进行编程,我正在尝试构建一个应用程序 (winforms),但我遇到了以下问题...我需要我的应用程序在连接或不连接到 mssql 数据库的情况下工作,这对于我们的朋友 DataSet 来说听起来像是小菜一碟,对吗?我可以将数据持久保存为 XML 或二进制,直到我可以到达数据库并且数据集将神奇地同步;一切都不会打扰用户。 问题是......我读过的几本书只是提到了像童话故事一样的逻辑,但没有给出任何如何做到这一点的实际示例,你能给我指一个示例/演示/任何我可以阅读或下载的内容吗?具有(相同或)相似逻辑的应用程序?
i just have a few weeks programming with vc# (2008) and i'm trying to build an application (winforms) and i have the following problem... i need my application to work with and without connection to the mssql database, this sounds like piece of cake for our friend DataSet right? i can persist the data as XML or binary until i can reach the database and the DataSet will magically sync; all without bothering the user.
The problem is... the few books i have read just mention that logic like a fairy tale but dont give any practical example of how to do it, can you point me to one example/demo/whatever i can read or download of an application with (equal or) similar logic?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
序列化应该就是这么简单:
反序列化:(
大致...不靠近编译器进行正确的测试)
To serialize should be just this simple:
to deserialize:
(Roughly... not near compiler for proper testing)
如果您使用的是 DataSet,则只需使用 DataSet .WriteXml 和 DataSet.ReadXml。或者我错过了什么?
If you're using DataSet, you can just use DataSet.WriteXml and DataSet.ReadXml. Or am I missing something?