I have a DataTable populated with the following columns, UPC, NUMBER, DESCRIPTION, BRAND, UOM, GROUP, TOTAL_DOLLARS, TOTAL_UNITS, and DATE. They are all of type String except for Date, which is already in DateTime format.
I would like to either–
- (Ideally) write this DataTable to a SQL Server Database Table
- Copy this DataTable to another DataTable
–while converting all of the values in the TOTAL_DOLLARS column to Decimal and all of the values in the TOTAL_UNITS column to Int32. Note that there are no null values, so that shouldn’t be an issue.
Can this be done?
Thanks!
If values can be converteted without additional chances: