我怎样才能挽救我的DataGridView没有任何数据库? [英] How can I save my datagridview without any Databases?

查看:116
本文介绍了我怎样才能挽救我的DataGridView没有任何数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个有一个的DataGridView我可以添加或从本DataGridView中删除一些行的C#Windows形式,但现在我不知道我怎么能救我的变化,所以每次我打开我的窗口时间,我可以看到我添加的行。

I have created one C# Windows form that have one DataGridView I can add or remove some row from this DatagridView, but now I wonder how can I save my changes, so every time I open my window I can see my added row.

PS:我必须提到,我不希望使用任何数据库,有没有什么解决办法结果
是有可能做到这一点与C#?应用程序设置?

P.S.: I must mentioned that I don't want use any databases, is there any solution?
Is it possible to do that with C# Application settings?

推荐答案

坚持内容制作成的DataSet (BOO嘶)和序列化,要要么一个二进制文件或XML

Stick the contents into a DataSet (boo hiss) and serialize that to either a binary file or as XML.

让我们都笑了本文的锋芒的标签:

Let's all laugh at the "cutting edge" label of this article:

http://msdn.microsoft.com/en-us/magazine/cc163911.aspx

这不会需要一个数据库,只是一个文件。

It won't require a database, just a file.

如果你走这条路,你然后可以数据网格绑定到该备份的DataSet ,这将与内容填充的DataSet 的过程轻松了许多。

If you go this route, you could then data bind your grid to this backing DataSet, this will make the process of populating the DataSet with the contents a lot easier.

这篇关于我怎样才能挽救我的DataGridView没有任何数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆