protected void Page_Load(object sender, EventArgs e) { try { mainDSTableAdapters.Dashboard_Interest_IncomeTableAdapter intincome = new mainDSTableAdapters.Dashboard_Interest_IncomeTableAdapter(); mainDS.Dashboard_Interest_IncomeDataTable tblIntincome = intincome.GetData(DateTime.Now.AddMonths(-6).ToShortDateString(), DateTime.Now.ToShortDateString(), MySessionManager.CurrentUser.BranchID, 0, 0, 0); string myfinalDT = "[['Period','Interest Income'],"; int l = 0; for (int i = 0; i < tblIntincome.Rows.Count; i++) { if (i == (tblIntincome.Rows.Count - 1)) { myfinalDT += "['" + getMonth(Convert.ToInt32(tblIntincome[i].month)) + "'," + tblIntincome[i].InterestIncome + "]"; } else { myfinalDT += "['" + getMonth(Convert.ToInt32(tblIntincome[i].month)) + "'," + tblIntincome[i].InterestIncome + "],"; } l = l + 30; } myfinalDT += "]"; this.data_ii.Value = myfinalDT; } catch (Exception ex) { } }