John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Catégorie:
Bases de données
Versions des environnements
>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. :)
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement