private void FillBranchData() { objMaster = new Master(); objUtility = new UtilityDB(); try { cbBranchType.DataSource = objUtility.dtBranchType(); cbBranchType.ValueMember = "type"; cbBranchType.DisplayMember = "name"; cbStates.SelectedIndex = 0; cbBranchType.SelectedIndex = 0; } catch (Exception ex) { MessageBox.Show(ex.Message, "Add Branch", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { objMaster = null; } }
private void FillBranchType() { objMaster = new Master(); objUtility = new UtilityDB(); try { cbBranchType.DataSource = objUtility.dtBranchType(); cbBranchType.ValueMember = "type"; cbBranchType.DisplayMember = "name"; cbBranchType.SelectedValue = CommonData.BranchType; if (cbBranchType.SelectedIndex > 0) { FillBranchComboBox(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Add Outlet", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { objMaster = null; } }