将DataSet绑定到DropDownList
来源:互联网 发布:电脑淘宝网页打不开 编辑:程序博客网 时间:2024/05/16 01:04
设置:
DPcDAL pcdal = new DPcDAL();
DataSet ds = pcdal.selectById();
DataTable dt = ds.Tables[0];//0表示第一个表
if (ds != null && dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
this.DropDownList2.Items.Add(new ListItem("[" + dt.Rows[i]["pcId"].ToString() + "]" + dt.Rows[i]["pcname"].ToString(), dt.Rows[i]["pcId"].ToString()));
}
}
获取:
DropDownList 选中的值:DropDownList.SelectedItem.ToString();
- 将DataSet绑定到DropDownList
- 将数据源绑定到DropDownList
- Dataset 绑定 DropDownList 笔记
- datagrid中DropDownList绑定Dataset 的探究 未将对象引用设置到对象的实例 错误
- 如何将枚举绑定到DropDownList上
- 如何将枚举绑定到DropDownList上
- 将treeview绑定到dropdownlist中
- 如何将枚举绑定到DropDownList上
- DropDownList如何绑定DataTable,如何绑定DataSet
- 将ArrayList中的ListItem绑定到DropDownList中去
- 将数据表相关字段绑定到DropDownList控件
- 将表中的列绑定到DropDownList控件
- 枚举绑定到DropDownList
- 绑定到 DropDownList
- 利用RowFilter属性,将一个DataSet绑定到两个DataGrid
- 利用RowFilter属性,将一个DataSet绑定到两个DataGrid
- 利用RowFilter属性,将一个DataSet绑定到两个DataGrid
- 将GridView绑定到DataSet或DateReader上
- Android Selector 与 Shape 基本用法
- Java笔记——静态内部类/内部类
- UITabbarController
- android string.xml文件中的整型和string型代替
- easyUI布局篇使用jquery easy UI的panel和layout实现界面的自适用窗口
- 将DataSet绑定到DropDownList
- 怎样判断远程图片是否存在?
- rg.springframework.orm.hibernate3.LocalDataSourceConnectionProvider
- 似乎……
- 《当程序员的那些狗日日子》(三十一)特殊任务
- linux的线程同步机制
- the Struts dispatcher cannot be found. 在struts2中出现的问题
- SecureCRT 5.0序列号
- 将string转换为DateTime