XpoDefault.GetConnectionProvider(String, AutoCreateOption, out IDisposable[]) Method
Creates a data store provider (an IDataStore instance).
Namespace: DevExpress.Xpo
Assembly: DevExpress.Xpo.v24.2.dll
NuGet Package: DevExpress.Xpo
#Declaration
public static IDataStore GetConnectionProvider(
string connectionString,
AutoCreateOption defaultAutoCreateOption,
out IDisposable[] objectsToDisposeOnDisconnect
)
#Parameters
Name | Type | Description |
---|---|---|
connection |
String | A connection string. |
default |
Auto |
Specifies whether XPO can create a database or update its schema. |
objects |
IDisposable[] | An array of IDisposable objects the data store provider creates internally. |
#Returns
Type | Description |
---|---|
IData |
A data store provider. |
#Remarks
If the application no longer needs a connection provider object, dispose each object on the objectsToDisposeonDisconnect array.
The GetConnectionProvider method uses the ActiveConnectionString property if the connectionString parameter value is null (Nothing in Visual Basic).
The GetConnectionProvider method throws CannotFindAppropriateConnectionProviderException in the following situations:
A connection string does not contain the Xpo | To get a fully qualified connection string, use the Get |
A connection string references a Data Store Service and a target platform is .NET Core. | To connect a .NET Core project to a Data Store Service, create and configure Data |
#Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetConnectionProvider(String, AutoCreateOption, out IDisposable[]) method.
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.