Re: Performace problem with DataView.RowFilter

From: W.G. Ryan eMVP (WilliamRyan_at_NoSpam.gmail.com)
Date: 01/16/05


Date: Sun, 16 Jan 2005 17:49:42 -0500

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.languages.csharp)
  • 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)
  • Re: Performace problem with DataView.RowFilter
    ... Joe - Sahil is dead right on this - I had reset the filters a ... > 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)