Combine results of two Dataset in memory

I

Imran Aziz

Hello All,
I have a dataset that I populate using a SQL Server database, and the
second one that I populate using a mySQL Server database, I need to combine
the results in memory and then sort them, how do I go about doing that ?
This is a search query, so I do not want to create another temp table to do
this, any idea's please.

Imran.
 
J

jhcorey

I inherited a project that included a lot of this. Typically we might
create a third dataset
and populate it by iterating through the original two, taking the
values we needed.

We also had a module called DataSetHelper, which was probably found
somewhere on the web -- try googling for it. This provided a lot of
functionality (SelectDistinct,Min,Max).

I can't remember if sorting is available with the native
DataSet/DataTable.
 
G

Guest

For in-memory sorting and filtering, you could create a DataView from the
DataTable(s) in the DataSet and then do a DataView.Sort or DataView.RowFilter.
 
I

Imran Aziz

Thanks a lot for your response. I am now looking into the idea of creating a
new dataset in memory and merging the results from the other two dataset.

In addition since I am using ASP.net 2.0 I have come accross a Merge method
for Dataset that allows you to merge datasets but I get an error of
"<target>.nID and <source>.nID have conflicting properties:"

which I assume is based on the Merge taking the ID column as the primary key
hence trying to keep it unique, I will try to investige these possibilities
to sort this issue out. thanks a lot for your help.

Imran.
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top