Show / Hide Table of Contents

    OdbcHanaDataContext.OdbcHanaDataContext(OdbcConnection dbConnection) Constructor

    .NET Standard 2.x

    Initializes a new instance of the OdbcHanaDataContext class by passing the OdbcConnection type object as a parameter.

    Namespace: SnapObjects.Data.Odbc

    Assembly: SnapObjects.Data.Odbc.dll

    Syntax

    public OdbcHanaDataContext(OdbcConnection dbConnection) : base(dbConnection, new OdbcHanaDataContextOptions(String.Empty))
    

    Parameters

    dbConnection OdbcConnection

    The connection object which is an OdbcConnection instance.

    Examples

    The following code example uses the OdbcConnection object to initialize an instance of the `OdbcHanaDataContext class.

    using System;
    using System.Data.Odbc;
    using SnapObjects.Data.Odbc;
    
    namespace Appeon.ApiDoc.OdbcHanaDataContextExamples
    {
        public class OdbcHanaDataContextExample
        {
            public void Example2()
            {
                string hanaConnectionString = "Dsn=Hana Demo;uid=sa;pwd=sql";
                
                var hanaContext = new OdbcHanaDataContext(
                    new OdbcConnection(hanaConnectionString));
                    
                Console.WriteLine(hanaContext.ContextOptions.DatabaseType);
                
                /*This code produces the following output:
                
                    Odbc
                */
            }
        }
    }
    

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon