private void FullGuestBook() { DataTable dt = bllguestbooktype.GetList("1=1 order by id asc").Tables[0]; foreach (DataRow dr in dt.Rows) { guestType += "<option value=\"" + dr["id"].ToString() + "\">" + dr["dbo_typeName"].ToString() + "</option>"; } }
protected void FillDDL() { DataTable dt = bllguestbooktype.GetList("1=1").Tables[0]; this.ddlGuestType.DataTextField = "dbo_typeName"; this.ddlGuestType.DataValueField = "id"; this.ddlGuestType.DataSource = dt; this.ddlGuestType.DataBind(); this.ddlGuestType.Items.Insert(0, new ListItem("所有", "0")); }
private void BindData() { string strFiter = string.Empty; if (ViewState["fiter"] != null) { strFiter = ViewState["fiter"].ToString(); } DataTable dt = bllguestbooktype.GetList(strFiter).Tables[0]; this.GridView1.DataSource = dt; this.GridView1.DataBind(); }