将GridView数据导出到数据表,而无需使用for循环 [英] Export gridview data to datatable without using for loop

查看:70
本文介绍了将GridView数据导出到数据表,而无需使用for循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gridview(asp.net)中有可编辑的模板,在那些可编辑的模板中,我放置了文本框,客户端可以在其中进行更新

现在,我要读取的数据具有从gridview到datatable的更新更改,而无需使用任何类型的for循环



请为我提供解决方案

I have editable template in gridview (asp.net) in those editable template i placed textboxes where client can make the updation

Now what i want is read the data with updated changes from gridview to a datatable without using any kind of for loop



Please help me with solution

推荐答案

当客户端使用jQuery-AJAX对任何文本框进行更新时,您都可以更新数据库.
这样就可以保留用户的更改,而不会引起回发或刷新/重新绑定GridView.

现在,当您需要所有已更新的更改时,请在数据库上运行该SP/Query,该数据库是您最初用于绑定GridView的.您具有所有最新更改,而无需运行任何for循环.

希望有帮助.
When client makes an update on any of the textbox, using jQuery-AJAX you may update DB.
So that will persist user''s changes, without causing a postback OR refreshing/Re-binding the GridView.

Now, when you want all the updated-changes, run that SP/Query on the database, which you had used in the beginning to bind the GridView. You have all the latest changes without running any for-loop.

Hope that helps.


这篇关于将GridView数据导出到数据表,而无需使用for循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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