在DataGridView中更新数据 [英] Updating data in DataGridView
本文介绍了在DataGridView中更新数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用datagridview显示数据库中的数据,现在我想用数据库中新插入的数据更新datagridview
。我该怎么做?
解决方案
刷新页面以重新加载数据。 datagridview不仅仅是一个简单的表,而不是以手动方式搞乱它,只是让它做它并使用更新的数据重建自己。
你的意思是更新gridview in Asp.net或VB.net
正式地,我们需要重新绑定DataGridView
,如果插入/更新/删除对此进行的操作。在这种情况下,您需要从数据库中获取更新的数据并再次绑定DataGridView
。
- 阿米特
I have used datagridview to show the data from my database, now I want to update the datagridview
with the newly inserted data in my database. How can I do that?
解决方案
By refreshing the page so that the data is reloaded. A datagridview is more than a simple table, instead of messing with it in a manual way, just let it do it's thing and rebuild itself using the updated data.
You mean Update the gridview in Asp.net or VB.net
Formally, we need to rebind theDataGridView
, if Insert/Update/Delete operation performed on that. In this case, you do need to take updated data from database and bind theDataGridView
again.
--Amit
这篇关于在DataGridView中更新数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文