各位大侠,请教如下问题:
我想将SQL 数据库中 ASPABB 这张表中的ABB002这列的内容添加到DropDownList 控件中:请问如何复值string strcon=ConfigurationSettings.AppSettings ["sqlconn"]; SqlConnection conn = new SqlConnection(strcon );
conn.Open(); SqlCommand comm = new SqlCommand( "select ABB001,ABB002 from ASPABB"
,conn );//===================数据库表查询==========
SqlDataAdapter SDA = new SqlDataAdapter();
SDA.SelectCommand = comm; DataSet DS = new DataSet();
SDA.Fill(DS);DropDownList1.datasource=?DropDownList1.dataBin();
我想将SQL 数据库中 ASPABB 这张表中的ABB002这列的内容添加到DropDownList 控件中:请问如何复值string strcon=ConfigurationSettings.AppSettings ["sqlconn"]; SqlConnection conn = new SqlConnection(strcon );
conn.Open(); SqlCommand comm = new SqlCommand( "select ABB001,ABB002 from ASPABB"
,conn );//===================数据库表查询==========
SqlDataAdapter SDA = new SqlDataAdapter();
SDA.SelectCommand = comm; DataSet DS = new DataSet();
SDA.Fill(DS);DropDownList1.datasource=?DropDownList1.dataBin();
解决方案 »
- C# string.Format问题
- 关于泛型的问题
- 关于DropDownList绑定数据的问题?【急】
- 服务器配置是怎么回事?
- vs.2003 webform 中的正则表达式验证控件。是在客户端验证还是在服务器端验证的??
- 获取网页数据写入Oracle数据库
- 出Server Error in '/' Application.错是哪的问题
- vs2005用System.Net.Mail发送邮件出错"邮件标头中找到无效字符"
- 100分请求帮助
- 如何在网页中摸拟ie中的“前进”与“后退“!!
- 调用某个存储过程操作函数抱错,当前命令发生了严重错误。应放弃任何可能产生的结果。
- 各位大哥大姐帮帮忙!!!求高手
DropDownList1.DataBind();
DropDownList1.DisplayMember = "ABBOO1"; //显示内容所在的字段
DropDownList1.ValueMember = "ABBOO2"; //值所在的字段
DripDownList.DataSource = ds;
DripDownList.DataBind();
DropDownList1.DataSource = DS;
DropDownList1.DataBind();
DropDownList1.DisplayMember = "ABBOO1"; //显示内容所在的字段
DropDownList1.ValueMember = "ABBOO2"; //值所在的字段没找到DisplayMember, ValueMember这两个属性;
DropDownList1.DataValueField = "ABB002";
DropDownList1.DataSource = ds;
DropDownList1.DataBind();