Sharing ADO.NET Database Connections – PB Docs 126

Sharing ADO.NET Database Connections

PowerBuilder Classic applications can share database ADO.NET
connections with third-party .NET assemblies exposed as COM through
a connection proxy. The connection proxy is an instance of type
IAdoConnectionProxy.

The IAdoConnectionProxy interface is defined in the Sybase.PowerBuilder.DataSource.Sharing.dll assembly
as follows:

IAdoConnectionProxy {
object
Connection; //accepts System.Data.IDbConnection
object
Transaction; //accepts System.Data.IDbTransaction
event
EventHandler TransactionChanged;
}

Both the PowerBuilder application and the third-party assembly
manage connections and transactions by referencing the proxy.

The assembly must be registered as COM by using regasm.exe under
the Microsoft.NETFrameworkv4.0 folder. Please
refer to the Microsoft MSDN library for information about regasm.exe.

The PowerBuilder Transaction object is the standard PowerBuilder
nonvisual object used in database connections. To manage the shared
connection, the Transaction object references the AdoConnectionProxy
object using these methods:

  • bool SetAdoConnection (oleobject connectionProxy) – accepts
    an imported ADO.NET connection.

  • oleobject GetAdoConnection() – accepts
    an ADO.NET connection exported from the Transaction object.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x