Ejemplo n.º 1
0
        protected void SubTableBind()
        {
            BLL.Forum_PostSubTable bll        = new BLL.Forum_PostSubTable();
            System.Data.DataTable  tdSubTable = bll.GetList(20, "1=1", "[id] asc").Tables[0];

            this.ddlSubTable.Items.Clear();

            int AvailId = 0;

            foreach (DataRow dr in tdSubTable.Rows)
            {
                this.ddlSubTable.Items.Add(new ListItem(dr["Name"].ToString().Trim(), dr["id"].ToString().Trim()));

                if (dr["Avail"].ToString() == "1")
                {
                    AvailId = Convert.ToInt32(dr["id"].ToString());
                }
            }

            if (subTableId == 0)
            {
                subTableId = AvailId;
            }

            ddlSubTable.SelectedValue = subTableId.ToString();
        }
Ejemplo n.º 2
0
 private void RptBind()
 {
     BLL.Forum_PostSubTable bll = new BLL.Forum_PostSubTable();
     this.rptList.DataSource = bll.GetList(" 1=1 ");
     this.rptList.DataBind();
 }