So I have a DataTable data
that needs to get some column's content replaced.
string[] columns = { "Column1", "Column2", "Column3" };
int rowCount = data.Rows.Count;
int colCount = columns.Length;
for (int i = 0; i < rowCount; i++)
{
for (int j = 0; j < columnsCount; j++)
{
data.Rows[i][columns[j]] = "replace text";
}
}
The code does it's job, but it's slow as the DataTable has more records. 12k rows is around 4 minutes.
How could I speed up the process?