public Supervisor_Form() { Business_Layer.CLS_Add_Student sup = new Business_Layer.CLS_Add_Student(); InitializeComponent(); da = new SqlDataAdapter("SELECT ID AS 'ID',FIRST_NAME AS 'First Name',LAST_NAME AS 'Last Name',PHONE_NUMBER AS 'Phone Number',MAIL AS 'Mail',CITY AS 'City',SALARY AS 'Salary',HIRE_DATE AS 'Hire Date',ClASS AS 'Class Name' from SUPERVISOR", sqlcon); da.Fill(dt); metroGrid1.DataSource = dt; txtboxID.DataBindings.Add("text", dt, "ID"); txtboxFirstName.DataBindings.Add("text", dt, "First Name"); txtboxLastName.DataBindings.Add("text", dt, "Last Name"); txtboxPhoneNumber.DataBindings.Add("text", dt, "Phone Number"); txtboxEmail.DataBindings.Add("text", dt, "Mail"); txtboxCity.DataBindings.Add("text", dt, "City"); txtboxSalary.DataBindings.Add("text", dt, "Salary"); txtboxHireDate.DataBindings.Add("text", dt, "Hire Date"); txtboxClass.DataBindings.Add("text", dt, "Class Name"); bmb = this.BindingContext[dt]; lebPosition.Text = (bmb.Position + 1) + " / " + bmb.Count; txtboxClass.DataSource = sup.Get_All_Class(); txtboxClass.DisplayMember = "Get_All_Class"; txtboxClass.ValueMember = "CLASS_NAME"; }
public Add_Student() { InitializeComponent(); cmboxAcademic_Year.DataSource = stud.Get_All_Academic_Year(); cmboxAcademic_Year.DisplayMember = "ACADEMIC_YEAR"; cmboxAcademic_Year.ValueMember = "ID"; cmboxClass.DataSource = stud.Get_All_Class(); cmboxClass.DisplayMember = "Get_All_Class"; cmboxClass.ValueMember = "CLASS_NAME"; cmboxSupervisor.DataSource = stud.Get_All_Supervisor(); cmboxSupervisor.DisplayMember = "Get_All_Supervisor"; cmboxSupervisor.ValueMember = "FIRST_NAME"; cmboxFees.DataSource = stud.Get_Fees_Stauts(); cmboxFees.DisplayMember = "Get_Fees_Stauts"; cmboxFees.ValueMember = "FEES_STAUTS"; }