InformixDataContext.InformixDataContext(DB2Connection dbConnection) Constructor
.NET Standard 2.x
Initializes a new instance of the InformixDataContext class by passing the DB2Connection
type object as a parameter.
Namespace: SnapObjects.Data.Informix
Assembly: SnapObjects.Data.Informix.dll
Syntax
public InformixDataContext(DB2Connection dbConnection) : base(dbConnection, new InformixDataContextOptions(String.Empty))
Parameters
dbConnection
SqlConnection
The connection object which is a DB2Connection
instance.
Examples
The following code example uses a DB2Connection
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 Example2()
{
string CONNECTION_STRING = "Database=***;User ID=***;Password=***;Server=***";
var dataContext = new InformixDataContext(
new DB2Connection(CONNECTION_STRING));
Console.WriteLine(dataContext.ContextOptions.DatabaseType);
/*This code produces the following output:
Informix
*/
}
}
}
Applies to
.NET Standard
2.x