如何保存我的datagridview没有任何数据库? [英] How can I save my datagridview without any Databases?

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

问题描述

我已经创建了一个C#Windows窗体,它有一个DataGridView可以从这个DatagridView中添加或删除一些行,但现在我不知道如何保存我的更改,所以每次打开窗口时,我都可以看到我添加的行。



PS:我必须提到我不想使用任何数据库,有没有解决方案?

可以用C#应用程序设置?



解决方案

将内容粘贴到 DataSet (boo hiss)中,并将其序列化为无论是二进制文件还是XML。



我们大家都在笑这篇文章的前沿标签:



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



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



如果你去这条路线,你cou ld然后数据绑定您的网格到这个支持 DataSet ,这将使填充 DataSet 与内容a的过程很容易。


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.

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?

解决方案

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.

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天全站免登陆