protected void BindBankAccount() { DropDownList_bank.Items.Clear(); ListItem initItem = new ListItem("--请选择--", "-1"); DataTable dt = Lms.DAL.BankAccount.GetList(" and status=1"); DropDownList_bank.Items.Add(initItem); if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { ListItem item = new ListItem(); item.Value = dt.Rows[i]["id"].ToString(); item.Text = dt.Rows[i]["bank"].ToString() + ":" + dt.Rows[i]["accountno"].ToString(); DropDownList_bank.Items.Add(item); } } }
时间: 2024-11-08 02:15:18