locked
The type initializer for 'Sap.Data.Hana.HanaConnection' threw an exception RRS feed

  • Question

  • We are using asp.net mvc application to connecte SAP Hana database ussing Sap.Data.Hana.v4.5 dll version Version=2.4.171.0. This dll available on the system where we installed sap b1 client. 

    We are getting error at below line:

    HanaConnection conn = new HanaConnection();

    Could you please help us what causing this issue.

    The type initializer for 'Sap.Data.Hana.HanaConnection' threw an exception

    The specified module could not be found
    Sap.Data.Hana.v4.5

       at Sap.Data.Hana.HanaUnmanagedDll.LoadDll(String dllPath)
       at Sap.Data.Hana.HanaUnmanagedDll..ctor()
       at Sap.Data.Hana.HanaUnmanagedDll.get_Instance()
       at Sap.Data.Hana.HanaConnection..cctor()

    Thursday, August 27, 2020 4:03 PM

All replies

  • Hi Meraj M,

    Thank you for posting here.

    According to your description, your issue is more related to ASP.NET. Therefore, it will be more appropriate to ask your question in ASP.NET forum.

    Thank you for your understanding.

    Best Regards,

    Xingyu Zhao


    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 MSDNFSF@microsoft.com.

    Friday, August 28, 2020 1:25 AM
  • Thanks Xingyu Zhao


    Friday, August 28, 2020 9:14 AM