自动更新数据表 [英] Automatic update data table

查看:76
本文介绍了自动更新数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个数据表,该数据表正在page_load事件中填充.在同一页面上,我有两个按钮添加"和删除".每当我按下这些按钮时,就会在数据库的表中添加或删除记录.同时我想刷新数据表(按按钮时).

我想的一种方法是,我在按钮click事件时重新填充数据表,但这会影响应用程序的性能.

还有其他方法可以刷新数据表,然后请告诉我.

谢谢.

I am using a data table, which is filling at the page_load event. At same page i have two button ADD and REMOVE. Whenever I pressed these button a record add or remove from table in database. At same time i want to refresh data table (at the time of pressing buttons).

One way i am thinking is that i refill the data table at buttons click event, but it effect performance of application.

Have any other way to refresh the data table, then please tell me.

Thanks.

推荐答案

使用自定义对象或DataReader来获取信息. DataSet和Datatable在断开连接的环境中工作.使用添加和删除过程以及使用数据读取器或自定义对象来获取信息.

仍然需要在场景中使用DataTable,只需从Data View中删除记录(具有同时从表中删除的机制),以便它也将从UI中删除,并且不会重新填充数据表.

谢谢
Manoharan
Use custom objects or DataReader to fetch the information. DataSet and Datatable is working on a disconnected environment. Use procedure for Add & Remove and use Data Reader or Custom object to fetch the information.

Still you need DataTable in your scenario, Just remove the record from the Data View(Have the mechanism to remove from table also at the same time) so that it will remove from UI also and it won''t refill the datatable.

Thanks
Manoharan


这篇关于自动更新数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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