Link to home
Start Free TrialLog in
Avatar of CraigLazar
CraigLazar

asked on

how to check data type in dataset

Hi,

I simply need to test the datatypes in a datatable in my dataset in vb.net.
I need to check that there are no invalid values in my total columns.
I am reading in an xml file into a dataset, does it automatically assign the datatype to the coulmn based on the values in the xml file?


thanks allot
Avatar of Gyanendra Singh
Gyanendra Singh
Flag of India image

see you need to apply loop on datacolumn and use below property to find the datatype

 Yourcolumnname.DataType
Dataset1.Tables.Columns("column_nr").DataType
Avatar of CraigLazar
CraigLazar

ASKER

hi, ok this maybe a stupid question, but from what i understand from the above posts, that if i use this command it will tell me that the column has been assigned in the dataset for the datatable when it read in the xnl file?
so lets say there are 5 rows in the dataset, and column1 has 4 number values and 1 string value, would then the above command return as a string datatype?

then what datatpye do i declare and assign this function to so i can see the datatype?
thanks
ASKER CERTIFIED SOLUTION
Avatar of Gyanendra Singh
Gyanendra Singh
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks allot for the help
your welcome