如何将类别和子类别数据绑定到单个下拉列表中 [英] How to BindCategory And Subcategory data Into single Drop Down List

查看:58
本文介绍了如何将类别和子类别数据绑定到单个下拉列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将类别和子类别数据绑定到单个下拉列表中,如下所示



Science

--physics

--chemistry

--maths

艺术

- 泰米尔

- 英语

- 经济学

我在两个不同的表格中有类别和子类别数据。

任何人都可以帮助我,如何开发

I want to bind the category and subcategory data into single dropdownlist list as like the following

Science
--physics
--chemistry
--maths
Arts
--Tamil
--English
--Economics
I have the category and sub category data in two different table .
can any one help me ,how to develop

推荐答案

试试这个





string query =select c。类别+' - '+ b.Sub_Category来自Table1 c,Table2 b;





获取数据表中的数据然后将下拉列表绑定到数据表
try this


string query="select c.Category+'-'+b.Sub_Category from Table1 c,Table2 b";


fetch the data in datatable then bind dropdown list to datatable


检查这个我认为它会对你有帮助。
check this i think it will help you.


访问解决方案页面


这篇关于如何将类别和子类别数据绑定到单个下拉列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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