从gridview中的Dropdownlist将数据保存到数据库 [英] Saving data to database from Dropdownlist in gridview

查看:58
本文介绍了从gridview中的Dropdownlist将数据保存到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gridview,其中有10列,其中一个是下拉列表我想从中获取所选值并保存在数据库的特定列中,我想知道如何以及在何处访问此下拉列表。如果有代码那将是有用的plzzz帮助

i'm having a gridview in which it has 10 columns and one of which is a dropdown i wanna take the selected value from it and save in a specific column of a database i wanna know how and where to access this dropdownlist. if there is a code it will be useful plzzz help

推荐答案

简单,请按照下面的代码

its simple, please follow the below code
DropDownList lstuserName = (DropDownList)gvRow.FindControl("ddl_groub");
  Response.Write("Selected Value : " + lstuserName.SelectedValue + " " + "Selected Item : " + lstuserName.SelectedItem.Text);


这篇关于从gridview中的Dropdownlist将数据保存到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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