G
Guest
Hi Guys
I just want to let you know that my colleagues and I in the financial industry spend so much time trying to get data from csv/excel files into DataTables. Time and again, I find that OleDb provider fails us in so far as its interpretation of data type. Just today, I found that my "stable" file parser failed for a field. I predefined a DataTable and all columns so if there's any data type mismatch in the file, the user will know about it right away.
This morning, a file came in with a column with 60 rows that's all integer except the last 5 rows, where the data is floats
My DataTable defines this column to accept data of type double. OleDb sees the first 55 rows as int so it truncates all data values as it puts the data into my DataTable, causing miscalculations to happen later. Of course, int can fit into a column of type double, the problem goes unnoticed until the data is audited -- it's too late and too costly to fix then
Other than manually parsing these files (and there are many file formats in my organization), is there anything in the ADO.NET stack that can help with my *very common* situation
Thanks
Paul
I just want to let you know that my colleagues and I in the financial industry spend so much time trying to get data from csv/excel files into DataTables. Time and again, I find that OleDb provider fails us in so far as its interpretation of data type. Just today, I found that my "stable" file parser failed for a field. I predefined a DataTable and all columns so if there's any data type mismatch in the file, the user will know about it right away.
This morning, a file came in with a column with 60 rows that's all integer except the last 5 rows, where the data is floats
My DataTable defines this column to accept data of type double. OleDb sees the first 55 rows as int so it truncates all data values as it puts the data into my DataTable, causing miscalculations to happen later. Of course, int can fit into a column of type double, the problem goes unnoticed until the data is audited -- it's too late and too costly to fix then
Other than manually parsing these files (and there are many file formats in my organization), is there anything in the ADO.NET stack that can help with my *very common* situation
Thanks
Paul