Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating a column type in a dataset
Message
De
06/03/2007 10:54:11
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
À
06/03/2007 10:19:48
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01201032
Message ID:
01201048
Vues:
20
>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
Fil
Voir

Click here to load this message in the networking platform