• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 104
  • Last Modified:

VB.net DataTable colum type

Hi

I want to find out whether a column in my DataTable is numeric, date or text type.
How do I do this?
0
Murray Brown
Asked:
Murray Brown
  • 2
  • 2
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you have the DataColumn's datatype (Columns collection on the DataTable):
http://msdn.microsoft.com/en-us/library/system.data.datacolumn.datatype%28v=vs.110%29.aspx
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Hi

Thanks. I am working with an existing  Datatable pulled from SQL so I don't know
the column types. What VB.net code do I use to retrieve these types?

Thanks
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
as written above:
the DataTable has a Columns property, and you just examine that one, taking the column item you are interested in...
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
My mistake. Thanks very much Guy
Murray
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now