控件取表数据赋值

 <p>
            <label>
                机构ID :
            </label>
            <span>
                <asp:Label ID="LbInstitutionID" runat="server" Text="Label"></asp:Label></span></p>
        <p>

  

       

public void BindDataLb(string where) { DataSet ds = new DataSet(); StringBuilder strWhere = new StringBuilder(); strWhere = new StringBuilder(where); ds = bll.GetList(strWhere.ToString()); foreach (DataRow dr in ds.Tables[0].Rows) { HR.Model.Admin.P_LoanProduct model = new Model.Admin.P_LoanProduct(); model.InstitutionID = Convert.ToInt32(dr["InstitutionID"]); //机构ID : LbInstitutionID Turn(model); } } public void Turn(HR.Model.Admin.P_LoanProduct model) { HR.BLL.Admin.I_Institution bllInstitution = new HR.BLL.Admin.I_Institution(); DataSet ds = bllInstitution.GetList("InstitutionID=" + model.InstitutionID); LbInstitutionID.Text = ds.Tables[0].Rows[0]["InstitutionName"].ToString();//机构ID : LbInstitutionID ds = null; }
原文地址:https://www.cnblogs.com/woloveprogram/p/4632914.html