Dropdownlist数据绑定不上
DAL层是这样写的
public DataSet GetList(string strWhere) { StringBuilder strSql = new StringBuilder(); strSql.Append("select NewsTypeID,NewsType "); strSql.Append(" FROM Accounts_NewsType "); if (strWhere.Trim() != "") { strSql.Append(" where " + strWhere); } return SQLHelper.Query(strSql.ToString()); }
public DataSet GetList(string strWhere) { return dal.GetList(strWhere); }public DataSet GetAllList() { return GetList(""); }
private void BindNewsType() { BLL.Accounts_NewsType bll = new BLL.Accounts_NewsType(); DataSet ds = bll.GetAllList(); this. NewsType.DataSource = ds.Tables[0]; this.NewsType.DataTextField = "NewsType"; this.NewsType.DataValueField = "NewsTypeID"; this.NewsType.DataBind(); }