使用GridView中的下拉列表更新数据库 [英] Updating database using dropdownlist inside gridview

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

问题描述

我有一个绑定到数据库的gridview,其中一列是状态".
对于第一次注册的所有项目,状态值均初始化为OPEN.
如何使用gridview中的dropdownlist将Status列更新为CLOSE?

I have a gridview which is bound to a database and one of the columns is ''Status''.
Status value is initialized as OPEN for all items for the first registration.
how can I update Status column to CLOSE using dropdownlist inside gridview?

推荐答案

如果这是一个Web项目,您没有这么说.无论哪种方式,答案都是您使用SQL进行所需的更改.如果它是一个Web项目,我将使用一个AJAX调用,并传递正确的ID,但是通过两种方式,您都可以处理选择更改事件或提交"按钮的事件,以运行SQL .
If this is a web project, you did not say so. Either way, the answer is that you use SQL to make the changes you want. If it''s a web project, I''d use an AJAX call, passing in the correct id, but both ways, you handle a selection changed event, or the event of a ''commit'' button, to run your SQL.


请参考此链接.它会逐步教您.

http://technico.qnownow.com/2012/04 /05/use-dropdownlist-in-asp-net-gridview-control/ [
refer to this link. It teach you step by step.

http://technico.qnownow.com/2012/04/05/use-dropdownlist-in-asp-net-gridview-control/[^]


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

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