Show / Hide Table of Contents

    InformixDataContext.InformixDataContext(IDataContextOptions dataContextOptions) Constructor

    .NET Standard 2.x

    Initializes a new instance of the InformixDataContext class by passing the InformixDataContextOptions type object as a parameter.

    Namespace: SnapObjects.Data.Informix

    Assembly: SnapObjects.Data.Informix.dll

    Syntax

    public InformixDataContext(IDataContextOptions dataContextOptions) : base(dataContextOptions)
    

    Parameters

    dataContextOptions SnapObjects.Data.IDataContextOptions

    The options to be set for the DataContext object.

    Examples

    The following code example uses a InformixDataContextOptions object to initialize an instance of the InformixDataContext class.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Threading.Tasks;
    using IBM.Data.DB2.Core;
    using SnapObjects.Data.Informix;
    
    namespace Appeon.ApiDoc.InformixDataContextExamples
    {
        public class InformixDataContextExample
        {
            public void Example1()
            {
                string CONNECTION_STRING = "Database=***;User ID=***;Password=***;Server=***";
    
                var dataContext = new InformixDataContext(
                    new InformixDataContextOptions(CONNECTION_STRING));
    
                Console.WriteLine(dataContext.ContextOptions.DatabaseType);
    
                /*This code produces the following output:
                
                    Informix
                */
            }
        }
    }
    

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon