How to get DataType of a column

How can i get a column data type like varchar, char, smallint

DataColumn.DataType.Name returns string for varchar, nvarchar. I want exact data type. How can i get it.
ynainaAsked:
Who is Participating?
 
Juan_BarreraConnect With a Mentor Commented:
'For example, declare a column of type Integer:

Dim dc As New DataColumn
dc.DataType = GetType(Integer)

'Get it's type:

Dim t As Type = dc.DataType

'Then, do something with it:

Dim s As String
 If t Is GetType(Integer) Then
       s = "I'm an Integer"
 Else
       s = "I'm something else"
End If
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.