从数据库中读取数据,如何显示下拉菜单中的内容!

paulCheuh 2003-10-17 10:44:25
protected System.Web.UI.WebControls.Label fir_extinguisher;

数据库shou_a中字段fir为bit 其中1表示:好,2为中,3为差,4 为一般
谢谢!!!
把值赋给fir_extinguisher在网页中显示出来好,中,差,一般的其中一个!!!
...全文
283 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
inethax 2003-11-09
  • 打赏
  • 举报
回复
up
zhongkeruanjian 2003-11-04
  • 打赏
  • 举报
回复
csWM.Group GroupSort=null;

DataTable table = specialtyInfo.Tables[SpecialtyInfoDataSet.MUSTSUBJECT_TABLE];
count = table.Rows.Count;
if(count!=0)
{
for(int i=0 ;i<count;i++)
{
subject_Name = (string) table.Rows[i][SpecialtyInfoDataSet.SUBJECT_NAME_FIELD];
subject_Sort = (string) table.Rows[i][SpecialtyInfoDataSet.SORT_FIELD];

if(subject_Sort=="自然学")
{
GroupSort = NetMenu.Groups["Sort"].Items[0].Group;

}
if(subject_Sort=="经济学")
{
GroupSort = NetMenu.Groups["Sort"].Items[1].Group;


}
if(subject_Sort=="哲 学")
{
GroupSort = NetMenu.Groups["Sort"].Items[2].Group;

}
if(subject_Sort=="体育学")
{
GroupSort = NetMenu.Groups["Sort"].Items[3].Group;

}
if(subject_Sort=="音乐学")
{
GroupSort = NetMenu.Groups["Sort"].Items[4].Group;

}
if(subject_Sort=="法 学")
{
GroupSort = NetMenu.Groups["Sort"].Items[5].Group;

}
if(subject_Sort=="美 学")
{
GroupSort = NetMenu.Groups["Sort"].Items[6].Group;

}
if(subject_Sort=="信息学")
{
GroupSort = NetMenu.Groups["Sort"].Items[7].Group;

}
if(subject_Sort=="语言学")
{
GroupSort = NetMenu.Groups["Sort"].Items[8].Group;

}
if(subject_Sort=="其他学")
{
GroupSort = NetMenu.Groups["Sort"].Items[9].Group;

}
if(GroupSort!=null)
{
Item = GroupSort.Items.Add();
Item.Caption = subject_Name;
Item.IconImage = "./MenuImages/icon11.gif";
Item.IconHeight = 16;
Item.IconWidth = 16;
Item.IconPaddingRight = 12;
}
GroupSort = null;
}
for(int i=0 ;i<10;i++)
{
Item = NetMenu.Groups[0].Items[i];
if(Item.Group.Items.Count==0)
{
Item.Enabled =false;

}
}
yanyl2001 2003-11-04
  • 打赏
  • 举报
回复
下拉菜单的ID.items.add("1")
guoyan19811021 2003-10-24
  • 打赏
  • 举报
回复
.....
select case dataset.tables(0).rows(0)("fir").tostring
case 1
fir_extinguisher.text="好"
case 2
fir_extinguisher.text="中"
case 3
fir_extinguisher.text="差"
end select

paulCheuh 2003-10-24
  • 打赏
  • 举报
回复
protected System.Web.UI.WebControls.Label fir_extinguisher;

数据库shou_a中字段fir为tinyint类型,其中1表示:好,2为中,3为差,4 为一般
谢谢!!!
然后再把fir值赋给fir_extinguisher在网页中显示出来好,中,差,一般的其中一个!!!
paulCheuh 2003-10-24
  • 打赏
  • 举报
回复
完整点!!好吗?谢谢!
paulCheuh 2003-10-17
  • 打赏
  • 举报
回复
protected System.Web.UI.WebControls.Label fir_extinguisher;

数据库shou_a中字段fir为tinyint类型,其中1表示:好,2为中,3为差,4 为一般
谢谢!!!
把值赋给fir_extinguisher在网页中显示出来好,中,差,一般的其中一个!!!
阿拉丁 2003-10-17
  • 打赏
  • 举报
回复
将DB的东西读出来,然后显示
select shou_a case shou_a when '1' then 'HAO' when '2' then 'ZHONG' when '3' then 'CHA' else 'YIBAN' end as shou_aName from yourTable;


513 2003-10-17
  • 打赏
  • 举报
回复
问题不清,请重新整理

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧