void BindClassName() { string strErr = ""; DataTable objDataTable = new DataTable(); Manage.Class.Class objClass = new Manage.Class.Class(strConnection); int iRent = objClass.SearchClass1(out objDataTable, out strErr); if (iRent == 0) { MessageBox.Show(strErr); return; } else { cmbClassName.DataSource = objDataTable; cmbClassName.DisplayMember = "班级名称"; cmbClassName.ValueMember = "班级Id"; } }
void BindClassId() //绑定班级信息 { string strConnection = System.Configuration.ConfigurationManager.ConnectionStrings["StudentManager"].ConnectionString; Manage.Class.Class objClass = new Manage.Class.Class(strConnection); string strErr = ""; DataTable objDataTable = new DataTable(); int iRent = objClass.SearchClass1(out objDataTable, out strErr); if (iRent == 0) { MessageBox.Show(strErr); return; } else { cmbClassName.DataSource = objDataTable; cmbClassName.DisplayMember = "班级名称"; cmbClassName.ValueMember = "班级Id"; } }