John Baird
Coatesville, Pennsylvania, United States
>I am importing an Excel sheet into a dataset. So, of course, everything is now in character type. How can I update the dataset to specify that some columns are not integer and types like that?
I believe the column type of a defined column is immutable (once it contains data, you can't change the type). The only way I know how to do this would be to clone the dataset to get an empty structure, change the column type of the columns you want and then using foreach loop through the data rows collection, copy the values to a new datarow (performing the conversions first) and add the row to the new table.
It won't be pretty. :)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only