How to Spit Dataset

  • Thread starter Thread starter Niraj Ranka
  • Start date Start date
N

Niraj Ranka

Hello,

Can anyone please let me know, how can i split the dataset into two
datasets... based on some condition.

Thanx in advance
Niraj Ranka
 
Niraj,

A dataset is basicly only an object that holds tables and relations between
them.

So maybe you can tell what you want to split?

Cor
 
Hello,

Actually i have data from table based on groupid as 1 and 2, now i want to
bifercate the data in two datasets, one containing the data where groupid is
1 and second containing the data where groupid is 2.

Hope this will clear the picture.

Niraj A Ranka
 
Niraj,

I think that I would do it like this,

Create a new dataset

create a new datatable
Clone the datatable to that

http://msdn.microsoft.com/library/d...l/frlrfsystemdatadatatableclassclonetopic.asp

add that cloned datatable to the new dataset
ds.tables.add(table)

Make a reverse for index loop in the first datatable where in one time, the
datarow is imported with importrow in the result datatable and delete (maybe
in this case better remove, what depends what you want to do later with it)
in the sending datatable

http://msdn.microsoft.com/library/d...lrfsystemdatadatatableclassimportrowtopic.asp

That is all.

I hope this helps?

Cor
 

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

Back
Top