Typed DataTable Question

  • Thread starter Thread starter Bree
  • Start date Start date
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!
 
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.
 
Back
Top