Show / Hide Table of Contents

    InformixDataContextOptions.InformixDataContextOptions(string connectionString) Constructor

    .NET Standard 2.x

    Initializes a new instance of the InformixDataContextOptions class by passing the connection string as a parameter.

    Namespace: SnapObjects.Data.Informix

    Assembly: SnapObjects.Data.Informix.dll

    Syntax

    public InformixDataContextOptions(string connectionString) : base(DatabaseType.Informix)
    

    Parameters

    connectionString System.String

    A string containing connection information about how to connect to the data source.

    Examples

    The following code example uses a connection string to initialize an instance of the InformixDataContextOptions class.

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

    Applies to

    .NET Standard

    2.x

    Back to top Generated by Appeon