Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating a column type in a dataset
Message
From
06/03/2007 10:54:11
John Baird
Coatesville, Pennsylvania, United States
 
 
To
06/03/2007 10:19:48
General information
Forum:
ASP.NET
Category:
Databases
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01201032
Message ID:
01201048
Views:
21
>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
Map
View

Click here to load this message in the networking platform