Data structure with sql "LIKE" searchability?

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
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
D

Derrick

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
 
J

Jon Skeet [C# MVP]

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.
 
D

Derrick

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top