Ok, the story so far is i have a datatable, about 10,000 lines or so. and about 150 columns per row. ao more or less 150.000 cells in this datatable. i have all updateing working fine
but the updating is slow.
I need to iterate through a list of porcedures then update cells in the table depending on the procedure. when i am completle finished updating about 75% – 80% of all the cells will have changed.
I am using a search on the table using a primary key index assigened to an INT value.
datatable.rows.find() seems a a little quicker
datatable.select ( expression ) almost the same but little difference.
Is there any ideas who may speed this up. uppon changing 80,000 – 120,000 cells it can take minutes.
anyideas would be great thanks.
A study in the March 2005 issue of ASP.Net Pro magazine compared various approaches involving
DataTables,DataViewsandDataReaders. Their findings were that the fastest approach depended upon the number of records involved.For 50 records or less, by far the fastest search method was a
For..Nextloop on theDataTable's DataRowCollection. That approach was followed byDataRowCollection.Find. Many times slower were re-retrieving the data with aDataReader, usingDataView.RowFilter, and worst of all usingDataTable.Select.For 500 – 5,000 records, the fastest search was with
DataRowCollection.Find, followed closely byDataTable.Select. The worst by far for this range of records wereDataView.RowFilterandDataView.FindRows.For 50,000 records, the fastest search was accomplished with
DataRowCollection.Find.In a close second place was re-retrieving the records with aDataReader. The worst by far for this category wereDataView.RowFilterandDataView.FindRows.