InformixDataContextOptions<TAdoDbContext>.InformixDataContextOptions(string connectionString) Constructor
.NET Standard 2.x
Initializes a new instance of the InformixDataContextOptions<TAdoDbContext> class by passing the connection string as a parameter.
Namespace: SnapObjects.Data.Informix
Assembly: SnapObjects.Data.Informix.dll
Syntax
public InformixDataContextOptions(string connectionString) : base(connectionString)
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<InformixDataContext>
class.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using SnapObjects.Data.Informix;
namespace Appeon.ApiDoc.InformixDataContextOptions_GenericExamples
{
public class InformixDataContextOptions_GenericExample
{
public void Example()
{
string CONNECTION_STRING = "Database=***;User ID=***;Password=***;Server=***";
var options = new InformixDataContextOptions<InformixDataContext>(
CONNECTION_STRING);
var dataContext = new InformixDataContext(options);
Console.WriteLine(dataContext.ContextOptions.DatabaseType);
/*This code produces the following output:
Informix
*/
}
}
}
Applies to
.NET Standard
2.x