none
Connectivity between SAP HANA and .Net RRS feed

  • Question

  • Hi...

    Am facing a connectivity issue between the .Net and SAP HANA(64-bit) and am using ODBC driver(64-bit).

    I created the ODBC Driver(64-bit) for SAP HANA from Control Panel-->Administrative Tools under System DSN 

    I had inserted my code below, it throws an error at Connection.Open() like "The specified DSN contains an architecture mismatch between the Driver and Application"


    Web.config
    
    <add name="ODBCConnection" connectionString="DSN=HANA_Server;Uid=Username;Pwd=pwd"/>
    
    VB Code
    Imports System.Data
    Imports System.Data.Odbc
    Imports System.Configuration
    Public Class WebForm1
        Inherits System.Web.UI.Page
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim ConnectionString As String
            Dim Connection As OdbcConnection
            Dim Command As OdbcCommand
            ConnectionString = ConfigurationManager.ConnectionStrings("ODBCConnection").ToString
            Connection = New OdbcConnection(ConnectionString)
            Connection.Open()
            Command = New OdbcCommand("Select Column From Schema.Table_Name", Connection)
            Command.CommandType = CommandType.Text
            Connection.Close()
        End Sub
    End Class

    Could anyone please provide the solution between these too.

    Regards,

    Jegan Avinash





    • Moved by Carl Cai Monday, January 6, 2014 1:26 AM (from vb) more related
    • Edited by Jegan Avinash Monday, January 6, 2014 5:04 AM
    Friday, January 3, 2014 10:36 AM

Answers

  • Hello,

    On the side note, what odbc interface we used to create connection

    To manage a data source that connects to a 32-bit driver under 64-bit platform, use c:\windows\sysWOW64\odbcad32.exe. To manage a data source that connects to a 64-bit driver, use c:\windows\system32\odbcad32.exe.

    If we use the 64-bit odbcad32.exe to configure or remove a DSN that connects to a 32-bit driver, for example, Driver do Microsoft Access (*.mdb), we will receive the following error message:

    The specified DSN contains an architecture mismatch between the Driver and Application

    To resolve this error, use the 32-bit odbcad32.exe to configure or remove the DSN.

    A data source associates a particular ODBC driver with the data we want to access through that driver. For example, we might create a data source to use the ODBC dBASE driver to access one or more dBASE files found in a specific directory on the hard disk or a network drive. Using the ODBC Data Source Administrator, we can add, modify, and delete data sources, as described in the following table.

    http://msdn.microsoft.com/en-us/library/ms712362(VS.85).aspx

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 6, 2014 8:31 AM
    Moderator
  •  Is your .net Application using a 32 bit OS?

    Looking to your code, seems you are using an asp.net application, if so you can either enable (for 32 bit .net client) and disable (for 64bit .net client) in IIS->AppPool->Enable 32 bit Application.

    Sample-http://help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx


    Lingaraj Mishra

    Friday, January 10, 2014 1:53 PM

All replies

  • Hi,

    I have moved this thread to ADO.NET Managed Providers  forum for more dedicated support.

    Thanks for your understanding.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 6, 2014 1:25 AM
  • Hello,

    On the side note, what odbc interface we used to create connection

    To manage a data source that connects to a 32-bit driver under 64-bit platform, use c:\windows\sysWOW64\odbcad32.exe. To manage a data source that connects to a 64-bit driver, use c:\windows\system32\odbcad32.exe.

    If we use the 64-bit odbcad32.exe to configure or remove a DSN that connects to a 32-bit driver, for example, Driver do Microsoft Access (*.mdb), we will receive the following error message:

    The specified DSN contains an architecture mismatch between the Driver and Application

    To resolve this error, use the 32-bit odbcad32.exe to configure or remove the DSN.

    A data source associates a particular ODBC driver with the data we want to access through that driver. For example, we might create a data source to use the ODBC dBASE driver to access one or more dBASE files found in a specific directory on the hard disk or a network drive. Using the ODBC Data Source Administrator, we can add, modify, and delete data sources, as described in the following table.

    http://msdn.microsoft.com/en-us/library/ms712362(VS.85).aspx

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, January 6, 2014 8:31 AM
    Moderator
  •  Is your .net Application using a 32 bit OS?

    Looking to your code, seems you are using an asp.net application, if so you can either enable (for 32 bit .net client) and disable (for 64bit .net client) in IIS->AppPool->Enable 32 bit Application.

    Sample-http://help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx


    Lingaraj Mishra

    Friday, January 10, 2014 1:53 PM