DropDownList绑定数据
前:
<asp:DropDownList ID="Sort" runat="server"> </asp:DropDownList>
后:
string sqlcmd = "select * from NewsSort order by Title"; Sort.DataSource = Bangso.DBUtility.SQLHelper.ExecuteDataview(sqlcmd); Sort.DataTextField = "Title"; Sort.DataValueField = "ID"; Sort.DataBind();