private void PrepareBindingSources() { bs_vessels = new BindingSource(); DataTable tbl_vessels = new DataTable(); Vessel.FillVesselTable(MyConnection.GetConnection(), tbl_vessels); DataTable tbl_inspectiontypes = null; tbl_inspectiontypes = Vetting.Vetting.SelectInspectionTypes(MyConnection.GetConnection()); bs_vessels.DataSource = tbl_vessels; bs_inspectiontypes = new BindingSource(); bs_inspectiontypes.DataSource = tbl_inspectiontypes; this.dgvcol_InspectionTypeCmb.DataSource = bs_inspectiontypes; this.dgvcol_InspectionTypeCmb.DisplayMember = "InspectionType"; this.dgvcol_VesselId_cmb.DataSource = bs_vessels; this.dgvcol_VesselId_cmb.DisplayMember = "VesselName"; /* * DataTable tbl_requests = new DataTable(); * tbl_requests.Columns.Add("UserId", typeof(int)); * tbl_requests.Columns.Add("ComputerName", typeof(string)); * * tbl_requests.Columns.Add("UserName", typeof(String)); * tbl_requests.Columns.Add("RequestDate", typeof(DateTime)); * tbl_requests.Columns.Add("RequestCode", typeof(string)); * tbl_requests.Columns.Add("VetRequestId", typeof(int)); * tbl_requests.Columns.Add("Granted", typeof(byte)); * tbl_requests.Columns.Add("BriefcaseFile", typeof(string)); */ }
private void FormBriefcaseVessels_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'attendance_rdbms.Vessel' table. You can move, or remove it, as needed. Vessel.FillVesselTable(MyConnection.GetConnection(), this.attendance_rdbms.Vessel); try { Portable.FillVesselTable(this.m_filepath, this.m_password, this.attendance_briefcase.Vessel); } catch (Exception e1) { MessageBox.Show(e1.Message); } }