table: (userid int identifier(1,1) primary key , username varchar(20));string sql = "select userid , username from user_table";
System.Data.OleDb.OleDbConnection cnn = new System.Data.OleDb.OleDbConnection(".....");
System.Data.OleDb.OleDbDataAdapter custDA = new System.Data.OleDb.OleDbDataAdapter(sql , cnn);
System.Data.DataSet custDS = new System.Data.DataSet();
custDA.Fill(custDS);DropDownList1.DataSource = custDS.Tables[0];
DropDownList1.DataTextField = "username";
DropDownList1.DataValueField = "userid";
DropDownList1.DataBind();
解决方案 »
- 最后20分~两个递归分类查询~!请教
- vs2008专业版web网站没有Release选项,只有Debug,但是winform解决方案debug,release都有
- 移动硬盘故障
- 请教一个很简单的问题,谢谢
- 简单数据库帮定问题
- DataList的ItemTemplate项里加入的表格,如何传递给JS?
- 请教高人如何使用VS.NET中的水晶报表打印一个DataSet 中的数据?
- webdiyer 的分页控件,100万条数据分页,速度很快,翻到下一页,3秒,截图如下:http://www.rczx.com/ask/paging.gif
- DataGrid控件有没有办法实现一条记录分两行甚至多行显示?
- 给你60分,能告诉我,大家是如何调试asp.net程序?
- 圣诞到了,散分!祝大家年终拿到大红包!
- 哪位大哥可以告诉小弟dom如何使用啊
DataView dv = new DataView(DS.Tables[0];);
DropDownList1.DataSource = dv;
DropDownList1.DataTextField = "要帮定的列名";
DropDownList1.DataValueField = "要帮定的值";
DropDownList1.DataBind();