Show / Hide Table of Contents

    OdbcAseDataContext.OdbcAseDataContext(OdbcConnection dbConnection) Constructor

    .NET Standard 2.x

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

    Namespace: SnapObjects.Data.Odbc

    Assembly: SnapObjects.Data.Odbc.dll

    Syntax

    public OdbcAseDataContext(OdbcConnection dbConnection) : base(dbConnection, new OdbcAseDataContextOptions(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 OdbcAseDataContext class.

    using System;
    using System.Data.Odbc;
    using SnapObjects.Data.Odbc;
    
    namespace Appeon.ApiDoc.OdbcAseDataContextExamples
    {
        public class OdbcAseDataContextExample
        {
            public void Example2()
            {
                string aseconnectionString = "Dsn=ASE Demo;uid=sa;pwd=sql";
                
                var _aseContext = new OdbcAseDataContext(
                    new OdbcConnection(aseconnectionString));
                    
                Console.WriteLine(_aseContext.ContextOptions.DatabaseType);
                
                /*This code produces the following output:
                
                    Odbc
                */
            }
        }
    }
    

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon