Hi Lee,
"Lee Ottaway" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am manually creating a datatable in memory, creating columns etc for
> it and then populating it by importing data from files and various
> databases. Once I have the datatable in memory (which consists of
> around 10000 records) I need to be able to perform queries on it. I'm
> not talking about merely filtering or sorting it which I could do with
> a DataView, but performing real queries on it like grouping and
> counting.
>
> I can obviously do this by saving the datatable to a database and then
> using the OleDbDataAdapter to perform these kind of queries, but I
> don't want to have to save the data to a database, firstly because I
> don't need to store it and secondly because its incredibly slow saving
> 10000 records across a network.
>
> Is there a way I can perform SQL queries on a datatable that exists
> only in memory?
No, there isn't.
You might perform foreach loops (in combination with RowFilter perhaps)
though and check/calculate there.
You might also use DataTable.Select method.
--
Miha Markic [MVP C#] - RightHand .NET consulting & development
miha at rthand com
www.rthand.com