Show / Hide Table of Contents

    OracleDataContext.OracleDataContext(OracleConnection dbConnection) Constructor

    .NET Standard 2.x

    Initializes a new instance of the OracleDataContext class by passing the OracleConnection type object as a parameter.

    Namespace: SnapObjects.Data.Oracle

    Assembly: SnapObjects.Data.Oracle.dll

    Syntax

    public OracleDataContext(OracleConnection dbConnection) : base(dbConnection, new OracleDataContextOptions(String.Empty))
    

    Parameters

    dbConnection OracleConnection

    The connection object which is an OracleConnection instance.

    Examples

    The following code example uses an OracleConnection object to initialize an instance of the OracleDataContext class.

    using Appeon.ApiDoc.Models;
    using Oracle.ManagedDataAccess.Client;
    using SnapObjects.Data;
    using SnapObjects.Data.Oracle;
    using System;
    
    namespace Appeon.ApiDoc.OracleDataContextExamples
    {
        public class OracleDataContextExample
        {
            public void Example2()
            {
                DataContext dataContext = new OracleDataContext(new OracleConnection(CONNECTION_STRING));
    
                Console.WriteLine(dataContext.ContextOptions.DatabaseType);
    
                /*This code produces the following output:
    
                Oracle
                */
            }
        }
    }
    

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon