protected void bindroute() { try { ds2.Dispose(); ds2.Reset(); ds2 = d2.Bindroute(); if (ds2.Tables[0].Rows.Count > 0) { chklstroute.DataSource = ds2; chklstroute.DataTextField = "Route_ID"; chklstroute.DataValueField = "Route_ID"; chklstroute.DataBind(); chklstroute.SelectedIndex = chklstroute.Items.Count - 1; for (int i = 0; i < chklstroute.Items.Count; i++) { chklstroute.Items[i].Selected = true; if (chklstroute.Items[i].Selected == true) { count += 1; } if (chklstroute.Items.Count == count) { chkroute.Checked = true; } } } } catch (Exception ex) { d2.sendErrorMail(ex, collegecode, "TransportReport.aspx"); } }