Solved

VB.net DataTable colum type

Posted on 2015-01-05
4
97 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 143

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 143

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

790 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