I created a sub which reads all the sheets from an Excel .xlsx workbook into seprate DataTables in a DataSet using the Microsoft.ACE.OLEDB.12.0
data provider.
Now, I have one workbook with multiple sheets - All of which have the same column names - and what I'm trying to do is, once they are all loaded into the dataset, to merge them all into one large DataTable.
My problem is that even though all the sheets have the same columns, based upon the data in each sheet, sometimes the same columns get a Double
Data Type and other times they get a String
Data Type in the different tables of the DataSet, so, the Merge
function is giving me an error.
How can I fix this? Is there a way to set the Column datatypes ahead of time to all be string or is there a way to ignore column-type while merging or is there a better way to solve this altogether?
Thanks.