on 2024 Apr 07 12:17 PM
Hello
I need to connect SAP hana database using C# but I can't do it. I wrote python it connect successfully but in C# I can't do it.
Here this is python code. This code works good. I need to connect to server using my own local computer. (I don't have sap b1 app and sap hana app in my computer). Please write C# code to connect sap hana from local computer using C#.
import warnings
from hdbcli import dbapi
warnings.filterwarnings("ignore")
sap_db = "DATABASE_NAME"
address = "SERVER_IP_ADDRESS"
conn = None
try:
conn = dbapi.connect(
address=address,
port='PORT',
user='SYSTEM',
password='PWD',
)
# If no errors, print connected
print('connected')
# conn.close()
except Exception as e:
conn.close()
print(str(e))
sys.exit('Query failed......')
Request clarification before answering.
Kindly refer to the following post: Creating a C# Application Using SAP HANA and ADO.NET
Hope it helps!
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 40 | |
| 21 | |
| 15 | |
| 6 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.