Putting multipule Dataset tables into one table

K

kieran

Hi,

I have a dataset that has a number of tables in it, each table has only
one column - that column is the same name in each table.

I now want to have all these tables as one table and then loop through
the rows of this one table, and put them into an arraylist.

I was trying to do this using the dataview as I figure this must be the
tool to get all the table rows into one table (see below code).

Any and all help greatly appreciated.



Dim mySqlDataAdapter As SqlDataAdapter = New SqlDataAdapter(strSql,
myConn)
Dim myDataSet As DataSet = New DataSet
mySqlDataAdapter.Fill(myDataSet, "Values")
Dim dv As DataView
 
C

Cor Ligthert

Kieran,

How did you get the idea that the dataview should be the tool for that the
dataview is a view on *one* table.

When you want to make set all the columns in one arraylist than you have to
create first an object that is confirm the way you want to place that in it.
(a data class) and than loop though that)

In my opinion a lot of work while you can create as alternative to that as
well a new datatable and than loop generic through your dataset.

However probably this will fail. I think that you get the data from more
database tables. That needs something more than I tell now. Otherwise it is
just changing the Select and name all the columns you want.

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

Top