• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1205
  • Last Modified:

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
0
CraigLazar
Asked:
CraigLazar
  • 4
  • 2
1 Solution
 
Gyanendra SinghArchitectCommented:
see you need to apply loop on datacolumn and use below property to find the datatype

 Yourcolumnname.DataType
0
 
tiagosalgadoCommented:
Dataset1.Tables.Columns("column_nr").DataType
0
 
CraigLazarAuthor Commented:
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
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Gyanendra SinghArchitectCommented:
yes
0
 
Gyanendra SinghArchitectCommented:
Its return "Type" Object
refer this link for details
http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx
0
 
CraigLazarAuthor Commented:
Thanks allot for the help
0
 
Gyanendra SinghArchitectCommented:
your welcome
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now