Solved

VB.net DataTable colum type

Posted on 2015-01-05
4
94 Views
Last Modified: 2015-01-05
Hi

I want to find out whether a column in my DataTable is numeric, date or text type.
How do I do this?
0
Comment
Question by:murbro
  • 2
  • 2
4 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40531067
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
 

Author Comment

by:murbro
ID: 40531095
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
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 40531111
as written above:
the DataTable has a Columns property, and you just examine that one, taking the column item you are interested in...
0
 

Author Closing Comment

by:murbro
ID: 40531169
My mistake. Thanks very much Guy
Murray
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now