我如何更新GridView中的更改 [英] How can i update changes in gridview
本文介绍了我如何更新GridView中的更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尊敬的老人,
我已经在表格的gridview中显示了一个表格.
现在,我想在gridview单元格中进行更改,当我单击保存"时,这些更改应反映回数据库中,并且应该更新griview.
Dear seniours,
I have showed a table in gridview on a form.
Now i want to make changes in the gridview cells and when i click save these changes should be reflected back in database and my griview should be updated.
推荐答案
请参阅以下链接.
http://www.wherecanibuyit.co.uk/ASP/fully_editable_gridview.html [ ^ ]
http://dotnetdiscussion.net/2007/09/26/aspnet -gridview-updateeditcancel-hyperlinkfields-and-datakey-retrieval/ [在ASP.NET中的Gridview中编辑单元格 [在ASP.NET中编辑各个GridView单元格 [
Refer following links.
http://www.wherecanibuyit.co.uk/ASP/fully_editable_gridview.html[^]
http://dotnetdiscussion.net/2007/09/26/aspnet-gridview-updateeditcancel-hyperlinkfields-and-datakey-retrieval/[^]
Edit Cells in Gridview in ASP.NET [^]
Edit Individual GridView Cells in ASP.NET[^]
Hope this will help!
更新数据库时,请尝试在更新过程结束时从数据库中读取数据.
When you update the database you sould try reading the data from it at the end of your update procedure.
private void UpdateData(){
// ... Update logic
ReadDataFromTheDatabase();
}
注意:如果您使用tableAdapters更新,如果我确实记得,Update方法将dataTable与数据库中的数据同步.
Note: if you use tableAdapters to update, if I recall corectly, the Update method syncronizes the dataTable with the data in the database.
它也有C#示例
http://www.dotnetspider.com/forum/182755-data-gridview-edit-delete-update-C-net.aspx
http://en.csharp-online.net/Working_with_Data%E2%80%94Using_the_DataGridView
it has C# examples also
http://www.dotnetspider.com/forum/182755-data-gridview-edit-delete-update-C-net.aspx
http://en.csharp-online.net/Working_with_Data%E2%80%94Using_the_DataGridView
这篇关于我如何更新GridView中的更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文