-2

I have the following code that is compatible with MS SQL. I use it to log errors using Log4Net.

How do I make this compatible with SAP HANA, as in the correct syntax?

string connectionString = @"Data Source=server;Initial Catalog=SBODemoUS;Persist Security Info=True;User ID=sa;Password=pass";

appender.CommandText = string.Format("INSERT INTO {0} ([Date],[Thread],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @thread, @log_level, @logger, @message, @exception)", logTableName);

appender.ConnectionType = "System.Data.SqlClient.SqlConnection, System.Data,Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089";
appender.ConnectionString = connectionString;

I am particularly interested in the INSERT statement and what string to place in the appender.ConnectionType

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Kinyanjui Kamau
  • 1,890
  • 10
  • 55
  • 95

1 Answers1

1

SAP Bussines One has a .NET SDK as well as SAP HANA, but in this case you are trying to insert something to the HANA DataBase not to SQL Server, so your code cannot be re-used

Victor Hugo Terceros
  • 2,969
  • 3
  • 18
  • 31