Entity framework with SAP HANA

Viewed 2183

I have built a WPF application with Entity Framework on SQL Server as database. I am trying to migrate the same application with SAP HANA as database. Following the same approach, I have created the tables in HANA db and now trying to add an entity model in the solution by following this SAP help: SAP HANA Client Interface Programming Reference

While adding the entity model, after selection of data source and option to include sensitive data in connection string, the wizard disappears. Please help if anyone has used entity framework with HANA.

I have used all the 32 bit versions of HANA client available on SAP market place without any success.

1 Answers

You can use Entity Framework by using the adding a reference to the dll provided in the installation directory.

The name of the dll is System.Data.CData.SAPHANA.Entities.EF6.dll and you should have installed EntityFramework using Install-Package EntityFramework -Version 6.3.0 command. Please don't forget to use the version flag because it didn't work with another version and I didn't try to know why.

Now the remaining thing is the connection string

<add name="HANA_DbContext" connectionString="Offline=False;User=system;
Password=Secret_Pass;Server=hana.office.internal.com;
Database=company_erp;" providerName="System.Data.CData.SAPHANA" />

Here now, everything should work correctly as if it works MySQL, SQL Server or another ORM

Related