Clone(Type : DalConnectionType): ISecurityConnection;
Clone(Prognoz.Platform.Interop.Dal.DalConnectionType): Prognoz.Platform.Interop.Metabase.ISecurityConnection;
Type. Parameter that determines connection type with database.
The Clone method creates specific copy of connection.
To execute the example, connect the Metabase, Dal and Db system assemblies to the module.
Sub UserProc;
Var
MB: IMetabase;
DB: IDatabaseInstance;
Connect: ISecurityConnection;
CloneConnect: ISecurityConnection;
Connect2: ISecurityConnection2;
Command: IDalCommand;
Begin
MB := MetabaseClass.Active;
DB := MB.ItemById("BD").Open(Null) As IDatabaseInstance;
Connect := DB.Connection;
Connect2 := Connect As ISecurityConnection2;
debug.WriteLine(Connect2.Type);
CloneConnect := Connect2.Clone(DalConnectionType.FastInsert);
End Sub UserProc;
After executing this example connection type is displayed in the console window and a copy of installed connection (Connection for fast insert) is created.
To execute the example connect the Dal and Db system assemblies to the NET.module.
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Dal;
Imports Prognoz.Platform.Interop.Db;
...
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
DB: IDatabaseInstance;
Connect: ISecurityConnection;
CloneConnect: ISecurityConnection;
Connect2: ISecurityConnection2;
Command: IDalCommand;
Begin
MB := Params.Metabase;
DB := MB.ItemById["BD"].Open(Null) As IDatabaseInstance;
Connect := DB.Connection;
Connect2 := Connect As ISecurityConnection2;
System.Diagnostics.Debug.WriteLine(Connect2.Type);
CloneConnect := Connect2.Clone(DalConnectionType.dctFastInsert);
End Sub;
After executing this example connection type is displayed in the console window and a copy of installed connection (Connection for fast insert) is created.
See also: