Data structure with sql "LIKE" searchability?

  • Thread starter Thread starter news.microsoft.com
  • Start date Start date
N

news.microsoft.com

We need to take a large amount of data, load it into memory, and then search
on it. A hashtable would work if you could perform operations similar to
sql select .. where like ... clauses. Any data structure come to mind where
I could something like...

Object[] objs = hash["abc*"];

One other question, is it possible to create a hash with multiple keysets?
For example, an object, on keyset on name, one on some code?

TIA -

Derrick
 
Derrick,

A DataSet might be the best option in this case. You can load the data
into tables, and then call the Select method to select rows with specific
criteria. I believe the like operator is supported as well.

Hope this helps.
 
Hi Nicholas -

Thanks, I'm looking at DataSet and DataTable. We basically want to create a
relatively small in memory table based on xml files, and do simple where
like searches. Can DataSet and DataTable operate independently of an actual
relational db?

Thanks again -

Derrick


Nicholas Paldino said:
Derrick,

A DataSet might be the best option in this case. You can load the data
into tables, and then call the Select method to select rows with specific
criteria. I believe the like operator is supported as well.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

news.microsoft.com said:
We need to take a large amount of data, load it into memory, and then search
on it. A hashtable would work if you could perform operations similar to
sql select .. where like ... clauses. Any data structure come to mind where
I could something like...

Object[] objs = hash["abc*"];

One other question, is it possible to create a hash with multiple keysets?
For example, an object, on keyset on name, one on some code?

TIA -

Derrick
 
Derrick said:
Thanks, I'm looking at DataSet and DataTable. We basically want to create a
relatively small in memory table based on xml files, and do simple where
like searches. Can DataSet and DataTable operate independently of an actual
relational db?

Absolutely. Indeed, you might want to look at the XmlDataDocument
class.
 
Hi Jon -

I've been looking at the QuickStart example of reading books.xml and xsd,
can't find any samples that execute an actual sql command though, you
wouldn't happen to have a code snippet handy, would you?

Thanks!

Derrick
 
Back
Top