I am using
DataView.Rowfilter for getting one single row from a table for particular condition.
It's taking too much time, because I'm referring a table of thousand records around five hundred times...
Is there any other way to reduce the time for same functionality?
If we use for loop whether it will reduce the time?
Why don't try you using LINQ instead?
Even better, try using multiple threads in a thread pool to do it.
Yeah, scrap your design and redo it. If you're filtering throught thousands of rows, you're forcing RowFilter to look at each and every one of those records.
The DataTable is not indexed, so there's no way to speed it up using RowFilter. If you insist on using RowFilter, you're going to have to create your own index on the table, besed on your filter criteria, then implement a method that emulates RowFilter and uses this index to find the row it needs faster.
Or, you could skip all this work and do it the easy way by having the database find that one record for you, MUCH faster than a DataView could.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)