I have C# code that does this:
// This returns 10,000 rows quite quickly, but displaying them below is slow
DataTable dt = GetUsageStats();
string html = "<table>";
// This part is really slow
foreach (DataRow dr in dt.Rows)
{
html += "<tr>";
html += "<td>" + dr["column1"].ToString() + "</td>";
html += "<td>" + dr["column2"].ToString() + "</td>";
...
html += "<td>" + dr["column5"].ToString() + "</td>";
html += "</tr>";
}
html += "</table>";
The foreach goes so slow because of the 10,000 or so records. Is there any mechanism to speed this process up?
Thanks!
` ?
– I4V Sep 06 '13 at 20:01