on 11-09-2017 7:35 AM - last edited on 02-04-2024 12:23 AM by postmig_api_4
Hello experts,
I am trying to perform queries on a SAP Hana database on SAP Business One.
I have the following code:
// Establish an active connection to the SAP HANA database
HanaConnection conn = new HanaConnection("Server=192.*.*.*:30015;
databaseName=SBODEMOGB;UserID=SYSTEM;Password=blablabla");
//Open the database connection
conn.Open();
The error gets thrown on conn.Open(); The error is as below:
Sap.Data.Hana.HanaException was unhandled by user code
ErrorCode=-2147467259
HResult=-2147467259
Message=general error: database 'SBODEMOGB' does not exist
NativeError=2
Source=SAP HANA Data Provider for Microsoft ADO.NET
What could be wrong?
Any help appreciated.
Kinyanjui
Got the solution.
Just get rid on databaseName in the connection string and it works.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you want to pass Database name as well in the connection string use currentSchema=DbName.
Something like below:
// Establish an active connectionto the SAP HANA database
HanaConnection conn =new HanaConnection("Server=192.*.*.*:30015;
currentSchema=SBODEMOGB;UserID=SYSTEM;Password=blablabla"); //Open the databaseconnection
conn.Open();
Regards,
Aditya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.