data table question

G

Guest

hey all,

Dim _dt As New DataTable("Controls")
_dt.Columns.AddRange(New DataColumn() _
{New DataColumn("Name"), New DataColumn("Type")})

I saw this excerpt in an article on creating a stand alone data table. And I
was wondering if you don't specify the column type what would be the default.
I tested this and it let me add rows but doesn't it have to know the data
type of the column?

thanks,
rodchar
 
C

Chris

rodchar said:
hey all,

Dim _dt As New DataTable("Controls")
_dt.Columns.AddRange(New DataColumn() _
{New DataColumn("Name"), New DataColumn("Type")})

I saw this excerpt in an article on creating a stand alone data table. And I
was wondering if you don't specify the column type what would be the default.
I tested this and it let me add rows but doesn't it have to know the data
type of the column?

thanks,
rodchar

I believe it just saves it as an object type.

Chris
 
C

Cor Ligthert [MVP]

Rodchar,

Why do you use that underscore in VBNet, I become always crazy to check if
it is a concatination of the row in a message which is transported or meant
that it is a special use of a variable name.

It adds in my opinion nothing (only maybe with the value of a property in
VBNet however there I use m. and that you find alone in a get and set)

Meant as question,

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