Home All Groups Group Topic Archive Search About

Obtaining type of column in datatable

Author
5 May 2007 1:50 PM
Jeff
If I a column name for a datatable in vb.net 2005 and want to know whether
the column is a char or int how would I ask?

E.g., code starts like this. How do I obtain the type of column?

MyTable.Rows(0)("MyColumnUnknownIfCharOrInt")

Thanks

Jeff


--
Posted via a free Usenet account from http://www.teranews.com

Author
5 May 2007 3:35 PM
Scott M.
MyTable.Columns(columnToCheck).DataType


Show quoteHide quote
"Jeff" <n***@nothingX.com> wrote in message
news:463c7f62$0$16334$88260bb3@free.teranews.com...
>
>
> If I a column name for a datatable in vb.net 2005 and want to know whether
> the column is a char or int how would I ask?
>
> E.g., code starts like this. How do I obtain the type of column?
>
> MyTable.Rows(0)("MyColumnUnknownIfCharOrInt")
>
> Thanks
>
> Jeff
>
>
> --
> Posted via a free Usenet account from http://www.teranews.com
>