datatable question

G

Guest

Hello all
I have a dataset which contains 3 datatables. I traverse
each datatable and check the rows. I should be able to get
values out of these datatables and create a new datatable?
Is this possible? or does a datatable always have to be
associated with a SQL query or a SQL table? Thanks and I
appreciate your help very much.
 
N

Nicholas Paldino [.NET/C# MVP]

You can create a DataSet and DataTable without a SQL query. You can
create a new DataSet using the constructor with no parameters. You can then
create a new table and pass that to the Add method on the
DataTableCollection exposed by the Tables property on the DataSet. Then you
can add DataColumns to the DataTable through the Add method on the value
returned by the Columns property, and rows through the Add method on the
value returned by the Rows property.

There is nothing that limits you to using a DataSet with a database.

Hope this helps.
 
D

Dilip Krishnan

This is possible. The data set is basically an in memory database of
sorts. So any relational data/operation that you have can be represented
by a Dataset.
 

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

Similar Threads


Top