Quote:
I am trying to filter out the data and create new excel file out of the excel files collection I have in my directory. Currently I am using OLEDB command and I am running into error data type mismatch. I would like to know if it could be done using epplus or not and if so please share the code.
As to the data type mismatch
error message...
There's two reasons which may cause such of error:
1. A common reason is when Excel cannot convert data between data types...
See:
Type mismatch (Error 13) | Microsoft Docs[
^]
2. You're using
IMEX=1
in ExtendendProperties, which forces OledDb provider to treats Excel data as a string. See:
Microsoft ACE OLEDB 12.0 Connection Strings - ConnectionStrings.com[
^]
So, when you're trying to set value of cell/row which is differ than string, you'll see such of error.
Conclusion:
Use debugger to find out the line which causes error to be able to fix it!
As to the diffent frameworks/providers (epplus, etc.)...
Yes, you can use it, but you have to be completely sure that it would provide more advantages than disadvantages.