XPObjectSpaceProvider.GetDataStoreProvider(String, IDbConnection, Boolean) Method
Returns the data store provider.
Namespace: DevExpress.ExpressApp.Xpo
Assembly:
DevExpress.ExpressApp.Xpo.v24.1.dll
Declaration
public static IXpoDataStoreProvider GetDataStoreProvider(
string connectionString,
IDbConnection connection,
bool enablePoolingInConnectionString
)
Public Shared Function GetDataStoreProvider(
connectionString As String,
connection As IDbConnection,
enablePoolingInConnectionString As Boolean
) As IXpoDataStoreProvider
Parameters
Name |
Type |
Description |
connectionString |
String |
A string containing the database connection settings.
|
connection |
IDbConnection |
An IDbConnection object specifying the database connection.
|
enablePoolingInConnectionString |
Boolean |
true, if the connection pooling is enabled; otherwise, false.
|
Returns
Type |
Description |
DevExpress.ExpressApp.Xpo.IXpoDataStoreProvider |
An IXpoDataStoreProvider object.
|
You can pass the object returned by the static GetDataStoreProvider method to the XPObjectSpaceProvider constructor when registering the Object Space Provider in the XafApplication.CreateCustomObjectSpaceProvider event handler.
If you do not need to enable connection pooling, use another overload of this method that does not take the enablePooling parameter.
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetDataStoreProvider(String, IDbConnection, Boolean) 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.
xaf-how-to-access-the-master-detailview-information-from-a-nested-listview-controller/CS/WinWebSolution.Win/WinApplication.cs#L28
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) {
args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false));
args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null));
XAF_how-to-allow-a-user-to-select-the-authentication-type-at-runtime-e2371/CS/E2371.Win/WinApplication.cs#L34
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) {
args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false));
args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null));
xaf-how-to-extend-the-application-model/CS/ExtendModel.Win/WinApplication.cs#L32
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) {
args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false));
args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null));
XAF_Non-Persistent-Objects-Reloading-Demo/CS/NonPersistentObjectsDemo.Win/WinApplication.cs#L35
//args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false));
args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false));
args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null));
XAF-How-to-Implement-CRUD-Operations-for-Non-Persistent-Objects-Stored-Remotely/CS/NonPersistentObjectsDemo.Win/WinApplication.cs#L35
//args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false));
args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false));
args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null));
xaf-how-to-access-the-master-detailview-information-from-a-nested-listview-controller/VB/WinWebSolution.Win/WinApplication.vb#L32
Protected Overrides Sub CreateDefaultObjectSpaceProvider(ByVal args As CreateCustomObjectSpaceProviderEventArgs)
args.ObjectSpaceProviders.Add(New XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, True), False))
args.ObjectSpaceProviders.Add(New NonPersistentObjectSpaceProvider(TypesInfo, Nothing))
XAF_how-to-allow-a-user-to-select-the-authentication-type-at-runtime-e2371/VB/E2371.Win/WinApplication.vb#L36
Protected Overrides Sub CreateDefaultObjectSpaceProvider(ByVal args As CreateCustomObjectSpaceProviderEventArgs)
args.ObjectSpaceProviders.Add(New SecuredObjectSpaceProvider(CType(Security, SecurityStrategyComplex), XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, True), False))
args.ObjectSpaceProviders.Add(New NonPersistentObjectSpaceProvider(TypesInfo, Nothing))
xaf-how-to-extend-the-application-model/VB/ExtendModel.Win/WinApplication.vb#L34
Protected Overrides Sub CreateDefaultObjectSpaceProvider(ByVal args As CreateCustomObjectSpaceProviderEventArgs)
args.ObjectSpaceProviders.Add(New XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, True), False))
args.ObjectSpaceProviders.Add(New NonPersistentObjectSpaceProvider(TypesInfo, Nothing))
XAF_Non-Persistent-Objects-Reloading-Demo/VB/NonPersistentObjectsDemo.Win/WinApplication.vb#L37
'args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false));
args.ObjectSpaceProviders.Add(New XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, True), False))
args.ObjectSpaceProviders.Add(New NonPersistentObjectSpaceProvider(TypesInfo, Nothing))
XAF-How-to-Implement-CRUD-Operations-for-Non-Persistent-Objects-Stored-Remotely/VB/NonPersistentObjectsDemo.Win/WinApplication.vb#L37
'args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false));
args.ObjectSpaceProviders.Add(New XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, True), False))
args.ObjectSpaceProviders.Add(New NonPersistentObjectSpaceProvider(TypesInfo, Nothing))
See Also