I am working with a very large datatable which has 5000 rows and 8000 columns. In the data table there are some empty cells. I use the following code to fill the empty cells with 0. But since the datatable is very large, the speed is really slow!!! I just want to ask if there are some other ways instead of the for loop.
for (int i = 0; i < SP_dt.Rows.Count; i++)
{
for (int j = 0; j < SP_dt.Columns.Count; j++)
{
if (SP_dt.Rows[i][j].ToString() == "")
SP_dt.Rows[i][j] = 0;
Console.WriteLine("{0} {1}",i,j);
}
}