DataSet append

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • SePp

    DataSet append

    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 OracleDataAdapt er("Select * from view1");
    cmd.Tablemappin gs.Add("Table", "Views");


    cmd = new OracleDataAdapt er("Select * from view2");
    cmd.Tablemappin gs.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
  • SePp

    #2
    Re: DataSet append

    On Apr 7, 11:06 am, SePp <C_o_z_...@gmx. dewrote:
    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 OracleDataAdapt er("Select * from view1");
    cmd.Tablemappin gs.Add("Table", "Views");
    >
    cmd = new OracleDataAdapt er("Select * from view2");
    cmd.Tablemappin gs.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

    Comment

    • Cor Ligthert [MVP]

      #3
      Re: DataSet append

      Sepp,

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

      Cor

      "SePp" <C_o_z_m_o@gmx. deschreef in bericht
      news:2782712e-9d2c-4068-be85-5c7d7898cf87@a7 0g2000hsh.googl egroups.com...
      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 OracleDataAdapt er("Select * from view1");
      cmd.Tablemappin gs.Add("Table", "Views");
      >
      >
      cmd = new OracleDataAdapt er("Select * from view2");
      cmd.Tablemappin gs.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

      Comment

      Working...