private void FillStateComboBox() { objData = new StaffLevel(); try { DataTable dt = objData.GetStatesDS().Tables[0]; if (dt.Rows.Count > 1) { cbStates.DataSource = dt; cbStates.DisplayMember = "State"; cbStates.ValueMember = "CDState"; } cbStates.SelectedValue = CommonData.StateCode; cbStates.Enabled = false; dt = null; } catch (Exception ex) { MessageBox.Show(ex.Message, "Group To Destination", MessageBoxButtons.OK, MessageBoxIcon.Error); } finally { objData = null; } }
private void FillStateComboBox() { objState = new StaffLevel(); try { DataTable dt = objState.GetStatesDS().Tables[0]; if (dt.Rows.Count > 1) { cbStates.DataSource = dt; cbStates.DisplayMember = "State"; cbStates.ValueMember = "CDState"; } dt = null; } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { objState = null; } }