V
VM
Why is the third line of code in the loop take so long? W/o that line, the
execution (35,000 loops) runs in 3 secs. With the line, it goes up to over 5
mins.
dataGrid_auditAddress.DataSource = null;
for(int i=0;i<table_rowNums.Rows.Count; i++)
{
iRowNum = Convert.ToInt32(table_rowNums.Rows["col_rowNums"]); //this
table has all row numbers that will be modified
DataRow[] row_1 = DT_tempTable.Select("col_row = " +
iRowNum.ToString());
row_1[0]["col_mark"] = MARKED; //line that takes too long
}
dataGrid_auditAddress.DataSource = DT_tempTable;
Is there a better way of doing it?
execution (35,000 loops) runs in 3 secs. With the line, it goes up to over 5
mins.
dataGrid_auditAddress.DataSource = null;
for(int i=0;i<table_rowNums.Rows.Count; i++)
{
iRowNum = Convert.ToInt32(table_rowNums.Rows["col_rowNums"]); //this
table has all row numbers that will be modified
DataRow[] row_1 = DT_tempTable.Select("col_row = " +
iRowNum.ToString());
row_1[0]["col_mark"] = MARKED; //line that takes too long
}
dataGrid_auditAddress.DataSource = DT_tempTable;
Is there a better way of doing it?