I have following code:
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
for (int j = 0; j < ds.Tables[0].Columns.Count; j++)
{
strCsv.Append( XC.CleanForCsv(ds.Tables[0].Rows[i][j].ToString()) + ",");
}
strCsv.Append( "\r\n" + strCsv)
}
Dataset contains 8000 records. Looping through the records using a for loop after only 15 records strCsv.Append( "\r\n" + strCsv) statement throws an exception saying System.OutOfMemoryException. What is the reason behind this exception?