Re: Performace problem with DataView.RowFilter
From: Sahil Malik (contactmethrumyblog_at_nospam.com)
Date: 01/17/05
- Next message: Sahil Malik: "Re: Annoyance: Intellisense doesn't work for referenced typed datasets"
- Previous message: Sahil Malik: "Re: Performace problem with DataView.RowFilter"
- In reply to: W.G. Ryan eMVP: "Re: Performace problem with DataView.RowFilter"
- Next in thread: W.G. Ryan eMVP: "Re: Performace problem with DataView.RowFilter"
- Reply: W.G. Ryan eMVP: "Re: Performace problem with DataView.RowFilter"
- Messages sorted by: [ date ] [ thread ]
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)
>> {
>> ...
>> }
>> }
>>
>>
>
>
- Next message: Sahil Malik: "Re: Annoyance: Intellisense doesn't work for referenced typed datasets"
- Previous message: Sahil Malik: "Re: Performace problem with DataView.RowFilter"
- In reply to: W.G. Ryan eMVP: "Re: Performace problem with DataView.RowFilter"
- Next in thread: W.G. Ryan eMVP: "Re: Performace problem with DataView.RowFilter"
- Reply: W.G. Ryan eMVP: "Re: Performace problem with DataView.RowFilter"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|