Changing populated DataTable column data types
- by TonE
Hi,
I have a System.Data.DataTable which is populated by reading a CSV file which sets the datatype of each column to string.
I want to append the contents of the DataTable to an existing database table - currently this is done using SqlBulkCopy with the DataTable as the source.
However, the column data types of the DataTable need to be changed to match the schema of the target database table, handling null values.
I am not very familiar with ADO.NET so have been search for a clean way of doing this?
Thanks.