Share via


[SOLVED] Problem in deploying C# program that connect to SAP HANA DB

Question

Tuesday, October 2, 2018 8:09 AM

Hi,

I've developed on VS 2017 a program that make a SELECT on a SAP HANA DB.

My OS is Windows 7 64bit sp1. On this machine I've installed SAP Hana studio (64bit).

The program target "Any CPU".

My program runs well on my development pc (WIndows 10 64b), but on the production pc I got this error:

^^^^^^^^^^^
Unhandled Exception: System.TypeInitializationException: The type initializer fpr 'Sap.Data.Hana.HanaConnection' threw an exception > System.IO.FileNOtFound
Excpetion: Cannot find libSQLDBCHDB.dll
^^^^^^^^^^^

On this PC is installed SAP HANA CLIENT (both, 64 and 32  bit).

Any ideas?

LuKe

All replies (3)

Tuesday, October 2, 2018 9:00 AM | 1 vote

Solved.

The problem was a different version of dhe SAP HANA DLL.

LuKe


Tuesday, October 2, 2018 9:17 AM

Hi LuKe,

Since it was resolved, if possible, you could mark it as the answer, so it could help other community members, have a nice day.

Thanks,

Jack

MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected].


Wednesday, July 24, 2019 5:32 PM

I Have a similar problem with my application.

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Sap.Data.Hana.HanaConnection' threw an exception. > System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program%20Files'.

I changed the application  platform from x86  to x64, also i included this files in the aplicacion folder:

  1. libadonetHDB.dll
  2. libadonetHDB32.dll
  3. Sap.Data.Hana.v3.5.dll

That resolved my problem. I hope it helps somebody else.