private void FillDocumentMonthData() { objUtil = new UtilityDB(); try { string[] strBranchCode; DataTable dt; if (txtUserId.Text.Contains("admin")) { strBranchCode = cbCompany.SelectedValue.ToString().Split('@'); dt = objUtil.dtCompanyDocumentMonth(strBranchCode[0]); } else { strBranchCode = cbUserBranch.SelectedValue.ToString().Split('@'); dt = objUtil.dtCompanyDocumentMonth(strBranchCode[1]); } if (dt.Rows.Count > 0) { cbDocmentMonth.DisplayMember = "DocMonth"; cbDocmentMonth.ValueMember = "FinYear"; cbDocmentMonth.DataSource = dt; } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { objUtil = null; } }
private void FillDocMonth() { objUtil = new UtilityDB(); DataTable dt = new DataTable(); try { cbDocmonth.DataSource = null; dt = objUtil.dtCompanyDocumentMonth(CommonData.CompanyCode); if (dt.Rows.Count > 0) { cbDocmonth.DisplayMember = "DocMonth"; //cbDocmonth.ValueMember = "FinYear"; cbDocmonth.ValueMember = "DocMonth"; cbDocmonth.DataSource = dt; } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { dt = null; objUtil = null; } }