I have been using the method to import excel data to my WPF application as mentioned in
Import Excel file into Microsoft SQL Server using C#
and
Reading Excel files from C#
it works great on debug mode but on release mode it dies!
The problem is my client has moved to x64 based machines and the application works fine but just that this piece of code is not working on x64 just because there is no more “Microsoft .Jet.OLEDB.4.0” drivers made available for x64 machines any more.
I dont want to use office interop or provide any dependency for the user to have office installed on the machines.
So any suggestion to avoid this?
Try using
Microsoft.Ace.OLEDB.12.0drivers insteadWhen we started upgrading all our machines, all my queries using
Microsoft.Jet.OLEDB.4.0stopped working and I had to upgrade them to useMicrosoft.Ace.OLEDB.12.0. You shouldn’t need to do anything other than change your connection string for it to work.