DataSet append

S

SePp

Hi,

I have one dataset which is exported to an external file (excel)
My problem is that I want to append the data of two different views to
one dataset. (because they have to be displayed in an sheet among each
other)
Something like:

cmd = new OracleDataAdapter("Select * from view1");
cmd.Tablemappings.Add("Table", "Views");


cmd = new OracleDataAdapter("Select * from view2");
cmd.Tablemappings.Add("Table", "Views"); -- append to first table

cmd.Fill(ds, "Views");


Is there a way to do something like that?

Thank you very much in advance.

regards,

Sebastian
 
S

SePp

Hi,

I have one dataset which is exported to an external file (excel)
My problem is that I want to append the data of two different views to
one dataset. (because they have to be displayed in an sheet among each
other)
Something like:

cmd = new OracleDataAdapter("Select * from view1");
cmd.Tablemappings.Add("Table", "Views");

cmd = new OracleDataAdapter("Select * from view2");
cmd.Tablemappings.Add("Table", "Views"); -- append to first table

cmd.Fill(ds, "Views");

Is there a way to do something like that?

Thank you very much in advance.

regards,

Sebastian

Okay found a way in sql ....

select * from view1 union (all) select * from view2

cheers
sebastian
 
C

Cor Ligthert [MVP]

Sepp,

The DataSet.Merge(table) will merge every datatable inside a dataset.
(be aware that it is only the reference of course)

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

Top