MSSqlConnectionProvider(IDbConnection, AutoCreateOption) Constructor
Initializes a new instance of the MSSqlConnectionProvider class with the specified settings.
Namespace: DevExpress.Xpo.DB
Assembly: DevExpress.Xpo.v24.2.dll
NuGet Package: DevExpress.Xpo
#Declaration
public MSSqlConnectionProvider(
IDbConnection connection,
AutoCreateOption autoCreateOption
)
#Parameters
Name | Type | Description |
---|---|---|
connection | IDb |
An object implementing the IDb |
auto |
Auto |
An Auto |
#Remarks
Usually a Session object creates a connection provider manually based on the information supplied by the connection string. There are also cases when you need to create the connection provider manually via its constructor, for instance:
- when sharing a single IDataLayer object between multiple sessions. A connection provider should be passed to the data layer’s constructor. See the IDataLayer topic for additional information.
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MSSqlConnectionProvider(IDbConnection, AutoCreateOption) constructor.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.