Typed DataTable Question

B

Bree

Someone told me that I could create a Typed DataTable WITHOUT first
creating a Typed DataSet. I may be new to .NET programming, but I know
that, based on what I've learned, this isn't correct.

Am I right or not?

Thanks!
 
R

RobinS

Do you mean like this?

Dim dt as New DataTable
dt.Columns.Add(New DataColumn("FirstField", GetType(String)))
dt.Columns.Add(New DataColumn("SecondField", GetType(Integer)))
dt.Rows.Add("blahblah", 3)
dt.Rows.Add("morestuff", 4)

Or do you mean by using the DataSet Designer?

Or do you mean by reading a database?
Why would you want to? If you're trying to
get it into a table, you could read it into
a dataset and then cast the first table into
a datatable.

Robin S.
 

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