Show / Hide Table of Contents

    OdbcAseDataContext.OdbcAseDataContext(IDataContextOptions dataContextOptions) Constructor

    .NET Standard 2.x

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

    Namespace: SnapObjects.Data.Odbc

    Assembly: SnapObjects.Data.Odbc.dll

    Syntax

    public OdbcAseDataContext(IDataContextOptions dataContextOptions) : base(dataContextOptions)
    

    Parameters

    dataContextOptions SnapObjects.Data.IDataContextOptions

    The options to be set for the DataContext object.

    Examples

    The following code example uses the OdbcAseDataContextOptions 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 Example1()
            {
                string aseconnectionString = "Dsn=ASE Demo;uid=sa;pwd=sql";
    
                var _aseContext = new OdbcAseDataContext(
                    new OdbcAseDataContextOptions(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