如何在1个下拉列表中使用C#.NET获取MS Sql Server 2008数据库的3列数据 [英] how to gain 3 columns data of MS Sql Server 2008 database with C# .NET in 1 dropdownlist

查看:59
本文介绍了如何在1个下拉列表中使用C#.NET获取MS Sql Server 2008数据库的3列数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有C#.NET的MS Sql Server 2008数据库
我的表结构如下:

表1

Col1 Col2 Col3 Col4
M1 --- A --- B --- C
M2 --- E --- A --- G
M3 --- B --- C --- A
M4 --- F --- D --- B

在下拉列表中,与列-col1,col2和col3不同的值应显示为
-选择-
A
B
C
D
E
F
G

plz help

I am using MS Sql Server 2008 database with C# .NET
My table structure is as below:

Table1

Col1 Col2 Col3 Col4
M1 ---A---B---C
M2 ---E---A---G
M3 ---B---C---A
M4 ---F---D---B

In dropdown, distinct values from Column - col1, col2 and col3 should be displayed as
--Select--
A
B
C
D
E
F
G

plz help

推荐答案

我曾经使用过的一个选项显示为:
A B C
在这里说明:
http://aspnetgoodies.wordpress.com/category/multiple-columns -in-data-bound-drop-down-list/ [ http ://www.thomasclaudiushuber.com/blog/2008/07/31/developing-multicolumn-dropdowndropdownlist-with-aspnet-the-gridview-and-the-ajax-control-toolkit/ [ ^ ]
希望对您有帮助.
one option that i used once that displays as:
A B C
is explained here :
http://aspnetgoodies.wordpress.com/category/multiple-columns-in-data-bound-drop-down-list/[^]

http://www.thomasclaudiushuber.com/blog/2008/07/31/developing-multicolumn-dropdowndropdownlist-with-aspnet-the-gridview-and-the-ajax-control-toolkit/[^]
hope this will help you.


这篇关于如何在1个下拉列表中使用C#.NET获取MS Sql Server 2008数据库的3列数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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