Databind a dropdownlist

前端 未结 4 2046
梦毁少年i
梦毁少年i 2020-12-03 18:39

When I try to databing dropdownlist, got this: system.data.datarowview
what do I wrong?

 string strQuery = \"Select Item FROM         


        
4条回答
  •  臣服心动
    2020-12-03 19:17

    Try this..

     ddlList.DataSource = sqlTa;                 
     ddlList.DataTextField = "class";
     ddlList.DataBind();
    

    adding ddList.Value="somefield" is optional

提交回复
热议问题