By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,534 Members | 865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,534 IT Pros & Developers. It's quick & easy.

Q: Type of Column

P: n/a
Hi

How can I check the DataType of a column in a DataTable?

Could you give some example code?

Ta

Geoff
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Geoff,
You can check the DataColumn.DataType property.

http://msdn.microsoft.com/library/de...aTypeTopic.asp

Dim table As DataTable

For Each column As DataColumn in table.Columns

If column.DataType Is GetType(DateTime) Then
' do something interesting with a DateTime column
End If

Next

Hope this helps
Jay

"Geoff Jones" <ge***@NODAMNSPAM.com> wrote in message
news:40*********************@news.dial.pipex.com.. .
Hi

How can I check the DataType of a column in a DataTable?

Could you give some example code?

Ta

Geoff

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.