使用C#和asp.net在gridview中填充数据库中的下拉列表 [英] Populating a dropdownlist from database inside a gridview using C# and asp.net

查看:246
本文介绍了使用C#和asp.net在gridview中填充数据库中的下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有两个下拉列表,Dropdownlist 1和Dropdownlist 2,两个都需要从asp.net内的sql数据库填充网格视图 。我的下拉列表1显示了国家/地区列表,下拉列表2显示了州列表。因此,根据下拉列表1中的选择,下拉列表2应该从db填充。所以我的查询是:



1.如何在gridview中填充数据库中的下拉列表?



2.如何根据第一个下拉列表中的选择填充第二个下拉列表?

Hi All,

I have two dropdownlists say , Dropdownlist 1 and Dropdownlist 2, both of them need to be populated from the sql database inside an asp.net gridview . My Dropdownlist 1 shows me list of countries and Dropdownlist 2 shows list of states. So, depending upon the selection in dropdownlist 1 , dropdownlist 2 should populate from db. so my query is:

1. how to populate the dropdownlists from database inside the gridview?

2. how to populate the second dropdownlist based upon selection in the first dropdownlist?

推荐答案



查看此链接。它可能对你有帮助。

如何在asp.net的gridview中级联下拉列表? [ ^ ]



谢谢。
Hi,
check this link. it may help you.
How to cascading dropdownlist in gridview in asp.net?[^]

Thanks.


这篇关于使用C#和asp.net在gridview中填充数据库中的下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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