Solved

VB.net DataTable colum type

Posted on 2015-01-05
4
98 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
Help with exporting to excel 4 45
Sql server, import complete table, using vb.net 9 52
Add Combobox column to datagridview using vb.net 2 27
"lblTime is not declared" 3 35
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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