Re: Efficient local data-handling
- From: Göran Andersson <guffa@xxxxxxxxx>
- Date: Thu, 04 May 2006 14:52:47 +0200
You don't. Use the DefaultView of the DataTable, or create a new DataView, to sort the data.
Mantorok wrote:
Hi.
How do you sort a DataTable?
Thanks
Kev
Sort the table based on your key (test) values. While iterating via
loop, see if your current row fields match the fields of the next row.
"Mantorok" <spamthis@xxxxxxxx> wrote in message
news:cbc5da8829a458c83ce8aee8bff2@xxxxxxxxxxxxxxxxxxx
Hi all
I have a DataTable containing around 25000 rows. For each row I want
to query the entire DT to find out if potentially duplicate items
exist, problem is - this is reeeeeeaaaaal slow.
I'm using the Select method:
DataRow[] found = allClients.Select(
string.Format("ClientId <> '{0}' AND cl_sname = '{1}' AND
cl_fname = '{2}'",
row["ClientId"],
(row["cl_sname"] as string).Replace("'",
"''"),
(row["cl_fname"] as string).Replace("'",
"''")));
My question - is there a quicker way of doing this? BTW, the reason
why I'm doing this locally is because the DT is made up of data from
7 different sources.
Thanks
Kev
- References:
- Re: Efficient local data-handling
- From: Mark Newmister
- Re: Efficient local data-handling
- From: Mantorok
- Re: Efficient local data-handling
- Prev by Date: Re: Security Permission Issue with C# EXE on Intranet
- Next by Date: Re: Case Insensitive Search with Sensitive Replace
- Previous by thread: Re: Efficient local data-handling
- Next by thread: Catching PostMessage from a service
- Index(es):
Relevant Pages
|