Vamsi k

Vamsi k

  • NA
  • 296
  • 43k

performance issue

Oct 30 2018 4:23 AM
Hi All,
 
In the below code there are 24 list items were there. Every iteration all the 24 items getting exceuted. Here performance issue is happend. Based on the selected list item in the Listbox we need to get the each record from DataView. 
 
Kindly share your ideas. Please help me, It is very important. 
 
Note: customRCADSDV is DataView
===  lbRCADSFields is Listbox
for (int i = 0; i < customRCADSDV.Count; i++)//34093 records
{
//24 list items checking.
if (lbRCADSFields.Items[0].Selected) s1 += "<tr><td>" + customRCADSDV[i]["RecordId"].ToString() + "</td>";
if (lbRCADSFields.Items[1].Selected) s1 += "<td>" + customRCADSDV[i]["Name"].ToString() + "</td>";
if (lbRCADSFields.Items[2].Selected) s1 += "<td>" + customRCADSDV[i]["Title"].ToString() + "</td>";
if (lbRCADSFields.Items[3].Selected) s1 += "<td>" + customRCADSDV[i]["AsOwner"].ToString() + "</td>";
if (lbRCADSFields.Items[4].Selected) s1 += "<td>" + customRCADSDV[i]["CPDueDate"].ToString() + "</td>";
if (lbRCADSFields.Items[5].Selected) s1 += "<td>" + customRCADSDV[i]["CPCompleteDate"].ToString() + "</td>";
if (lbRCADSFields.Items[6].Selected) s1 += "<td>" + customRCADSDV[i]["RecordedDt"].ToString() + "</td>";
if (lbRCADSFields.Items[7].Selected) s1 += "<td>" + customRCADSDV[i]["Type"].ToString() + "</td>";
if (lbRCADSFields.Items[8].Selected) s1 += "<td>" + customRCADSDV[i]["Geo"].ToString() + "</td>";
if (lbRCADSFields.Items[9].Selected) s1 += "<td>" + customRCADSDV[i]["Documents"].ToString() + "</td>";
if (lbRCADSFields.Items[10].Selected) s1 += "<td>" + customRCADSDV[i]["BUOwner"].ToString() + "</td>";
if (lbRCADSFields.Items[11].Selected) s1 += "<td>" + customRCADSDV[i]["ExecCert"].ToString() + "</td>";
if (lbRCADSFields.Items[12].Selected) s1 += "<td>" + customRCADSDV[i]["RowCreatedDt"].ToString() + "</td>";
if (lbRCADSFields.Items[13].Selected) s1 += "<td>" + customRCADSDV[i]["CitnStatDsc"].ToString() + "</td>";
if (lbRCADSFields.Items[14].Selected) s1 += "<td>" + customRCADSDV[i]["RCOwner"].ToString() + "</td>";
if (lbRCADSFields.Items[15].Selected) s1 += "<td>" + customRCADSDV[i]["RowUpdatedDt"].ToString() + "</td>";
if (lbRCADSFields.Items[16].Selected) s1 += "<td>" + customRCADSDV[i]["Entity"].ToString() + "</td>";
if (lbRCADSFields.Items[17].Selected) s1 += "<td>" + customRCADSDV[i]["WrkflwStatDsc"].ToString() + "</td>";
if (lbRCADSFields.Items[18].Selected) s1 += "<td>" + customRCADSDV[i]["JrsdctnOrgNm"].ToString() + "</td>";
if (lbRCADSFields.Items[19].Selected) s1 += "<td>" + customRCADSDV[i]["CPDueNote"].ToString() + "</td>";//
if (lbRCADSFields.Items[20].Selected) s1 += "<td>" + customRCADSDV[i]["DocketNo"].ToString() + "</td>";
if (lbRCADSFields.Items[21].Selected) s1 += "<td>" + customRCADSDV[i]["LegalSME"].ToString() + "</td>";
if (lbRCADSFields.Items[22].Selected) s1 += "<td>" + customRCADSDV[i]["Synopsis"].ToString() + "</td>";
if (lbRCADSFields.Items[23].Selected) s1 += "<td>" + customRCADSDV[i]["EmailSchdl"].ToString() + "</td>";
s1 += "</tr>\n";
}

Answers (4)