Re: Performace problem with DataView.RowFilter

From: Sahil Malik (contactmethrumyblog_at_nospam.com)
Date: 01/17/05


Date: Sun, 16 Jan 2005 21:28:58 -0500

I'm not always dead right :-), but thanks anyway :-)

- Sahil Malik
http://dotnetjunkies.com/weblog/sahilmalik

"W.G. Ryan eMVP" <WilliamRyan@NoSpam.gmail.com> wrote in message
news:ejdQm0B$EHA.3596@TK2MSFTNGP12.phx.gbl...
> Joe - Sahil is dead right on this (as always) - I had reset the filters a
> while ago on 2,000+ rows - then redid it using GetChildRows - it went from
> taking around 12 seconds to complete to less than one. Night and day
> there.
>
> --
> W.G. Ryan MVP (Windows Embedded)
>
> TiBA Solutions
> www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
> "Joe" <J_no_spam@_no_spam_Fishinbrain.com> wrote in message
> news:#qca2VA$EHA.3840@tk2msftngp13.phx.gbl...
>>
>> Not sure what group this question is better suited for so I sent it to
> both.
>>
>> I have a DataTable which contains 1545 rows. I have a method that returns
> a
>> DataTable of distinct rows based on one column. This table ends up with
> 386
>> rows.
>>
>> I need to loop through the smaller table and filter a DataView based on
> each
>> row from this table.
>> This loops takes ~5 secs. Is there anyway to improve this?
>>
>> DataTable dt = SelectDistinctValues(...); // returns a table with 386
>> rows
>> foreach (DataRow dr in dt.Rows)
>> {
>>
>> dv.RowFilter = string.Format("value = '{0}'", dr[0].ToString() );
>>
>> foreach (DataRowView drv in dv)
>> {
>> ...
>> }
>> }
>>
>>
>
>



Relevant Pages

  • Re: Performace problem with DataView.RowFilter
    ... "Sahil Malik" wrote in message ... >>> I need to loop through the smaller table and filter a DataView based on ... >>> foreach ... >>> foreach (DataRowView drv in dv) ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Performace problem with DataView.RowFilter
    ... "Sahil Malik" wrote in message ... >>> I need to loop through the smaller table and filter a DataView based on ... >>> foreach ... >>> foreach (DataRowView drv in dv) ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Performace problem with DataView.RowFilter
    ... - Sahil Malik ... >> I need to loop through the smaller table and filter a DataView based on ... >> foreach ... >> foreach (DataRowView drv in dv) ...
    (microsoft.public.dotnet.framework.adonet)
  • Performace problem with DataView.RowFilter
    ... I need to loop through the smaller table and filter a DataView based on each ... foreach ... foreach (DataRowView drv in dv) ...
    (microsoft.public.dotnet.framework.adonet)
  • Performace problem with DataView.RowFilter
    ... I need to loop through the smaller table and filter a DataView based on each ... foreach ... foreach (DataRowView drv in dv) ...
    (microsoft.public.dotnet.languages.csharp)