G
Guest
Hi. I have profiled my code and discovered where the bottlenecks are:
1. To find unique records I have been using DataTable.Select() but this
appears to be quite slow. What is the fastest method of searching keyed data
for a row with a particular key value?
2. At one point I need to do cell by cell updates to my data. For example if
I have an array of values for a particular column I do this:
for( int rowIndex = 0; rowIndex < myTable.Rows.Count; ++rowIndex )
myTable.Rows[ rowIndex ][ "MyColumn" ] = myArray[ rowIndex ];
Again this is quite expensive. What can I do to speed up this kind of
update? Turn off constraints? Enable some kind of batch update?
Thanks
kh
1. To find unique records I have been using DataTable.Select() but this
appears to be quite slow. What is the fastest method of searching keyed data
for a row with a particular key value?
2. At one point I need to do cell by cell updates to my data. For example if
I have an array of values for a particular column I do this:
for( int rowIndex = 0; rowIndex < myTable.Rows.Count; ++rowIndex )
myTable.Rows[ rowIndex ][ "MyColumn" ] = myArray[ rowIndex ];
Again this is quite expensive. What can I do to speed up this kind of
update? Turn off constraints? Enable some kind of batch update?
Thanks
kh