I have a datagrid with several columns. When trying to validate the column
by looping through each column in the collection using a subscript I need to
first determine whether the column is defined as a string or an integer. Is
there a function that will allow me to do this? Note that the column types
and data remain the same. I just need to know whether the column is defined
as a string or integer to decide what validations to do.
Example:
Dim r As DataRow
Dim cols As DataColumnCollection
Dim c As DataColumn
cols = dstable1.Tables("Table1").Columns
For Each r In dstable1.Tables("Table1").Rows
For Each c In cols
If r(c, DataRowVersion.Current) ??? is string or integer
???
do something
next c
next r
thanks
Morten Wennevik - 15 Feb 2006 18:55 GMT
Hi mh1mark
Would you by any chance be looking for the DataColumn.DataType property?
> I have a datagrid with several columns. When trying to validate the column
> by looping through each column in the collection using a subscript I need to
[quoted text clipped - 18 lines]
>
> thanks

Signature
Happy coding!
Morten Wennevik [C# MVP]