Skip to Content
Former Member
Jul 20, 2017 at 05:16 PM

ERROR: HANA C# HanaConnection' exists in both 'Sap.Data.Hana.v3.5 & 4.5

453 Views Last edit Jul 21, 2017 at 08:34 PM 2 rev

Greetings Colleagues,

I am trying to build C# based app for HANA but i end up with errors thats un predictable.

so i added references for both the .net dlls.

now it dosent work and the code complains about the runtime.


<?xml version="1.0" encoding="utf-8" ?> <configuration>     <startup> 
   <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />     </startup>
   <connectionStrings>     <add name="Hana" connectionString="Server=localhost:30015;UserName=SYSTEM;Password=******" providerName="Sap.Data.Hana" /> </connectionStrings> </configuration>


using System;
using System.Collections.Generic;
using System.ComponentModel; 
using System.Data;
using System.Drawing;
using System.Linq; using System.Text; using System.Threading.Tasks;
using System.Windows.Forms; using Sap.Data.Hana; namespace WindowsFormsApp2
{     public partial class Form1 : Form

HanaConnection conn;         const string SCHEMA = "ASHLIN_PLAYAREA";       
const string PRODUCTS_TABLE = "T_POLY_RESULT_JOIN";         

public Form1()  {    


private void Form1_Load(object sender, EventArgs e)
conn = new HanaConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Hana"].ConnectionString);

HanaDataAdapter dataAdapter = new HanaDataAdapter("SELECT ID,EQUIPMENT  FROM " + SCHEMA + "." + PRODUCTS_TABLE, conn);           

DataTable testTable = new DataTable();            
dataGridView1.DataSource = testTable;
            //Format the grid (optional)
 dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);         }        

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)         {         }
    } }


using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp2
    static class Program
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
            Application.Run(new Form1());

Please tell me what is wrong with this code...



Error Description.

SeverityCodeDescriptionProjectFileLineSuppression State ErrorCS0433The type 'HanaConnection' exists in both 'Sap.Data.Hana.v3.5, Version=, Culture=neutral, PublicKeyToken=***********' and 'Sap.Data.Hana.v4.5, Version=, Culture=neutral, PublicKeyToken=0*********'WindowsFormsApp2C:\Users\scarl\Documents\Visual Studio 2017\Projects\WindowsFormsApp2\WindowsFormsApp2\Form1.cs16Active

i tried to resolve it myself but not really helped.


error.png (8.5 kB)
error2.png (19.8 kB)
error3.png (6.9 kB)