Re: Performace problem with DataView.RowFilter
From: W.G. Ryan eMVP (WilliamRyan_at_NoSpam.gmail.com)
Date: 01/17/05
- Next message: Edward Mitchell: "How to Move Many Web Form TextBox Strings into/out of a Database"
- Previous message: Carl Daniel [VC++ MVP]: "Re: ASP.net multithreading?"
- In reply to: Sahil Malik: "Re: Performace problem with DataView.RowFilter"
- Next in thread: Sahil Malik: "Re: Performace problem with DataView.RowFilter"
- Reply: Sahil Malik: "Re: Performace problem with DataView.RowFilter"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 16 Jan 2005 23:04:44 -0500
Well, every time I've seen. On this in particular though - the difference
is pretty nuts in a lot of cases. That's definitely one of those 'tips'
that is pure gold.
-- W.G. Ryan MVP (Windows Embedded) TiBA Solutions www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com "Sahil Malik" <contactmethrumyblog@nospam.com> wrote in message news:e6rbNxD$EHA.1264@TK2MSFTNGP12.phx.gbl... > 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: Edward Mitchell: "How to Move Many Web Form TextBox Strings into/out of a Database"
- Previous message: Carl Daniel [VC++ MVP]: "Re: ASP.net multithreading?"
- In reply to: Sahil Malik: "Re: Performace problem with DataView.RowFilter"
- Next in thread: Sahil Malik: "Re: Performace problem with DataView.RowFilter"
- Reply: Sahil Malik: "Re: Performace problem with DataView.RowFilter"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading