About the PowerBuilder ADO.NET database interface
You can use the PowerBuilder ADO.NET database interface to connect
to a data source such as Adaptive Server® Enterprise, Oracle,
and Microsoft SQL Server, as well as to data sources exposed through
OLE DB and XML, in much the same way as you use the PowerBuilder ODBC
and OLE DB database interfaces.
Performance You might experience better performance if you use a native
database interface. The primary purpose of the ADO.NET interface
is to support shared connections with other database constructs
such as the .NET DataGrid in Sybase DataWindow .NET.
Components of an ADO.NET connection
When you access a database using ADO.NET in PowerBuilder, your connection
goes through several layers before reaching the database. It is important
to understand that each layer represents a separate component of
the connection, and that components might come from different vendors.
The PowerBuilder ADO.NET interface consists of a driver (pbado100.dll)
and a server (pbdata100.dll). Both DLLs must
be deployed with an application that connects to a database using
ADO.NET.
In this release, the PowerBuilder database interface for ADO.NET
supports the .NET namespace System.Data.OleDb, which is the .NET
Framework data provider for OLE DB, and the .NET namespace System.Data.SqlClient,
which is the .NET Framework data provider for Microsoft SQL Server.
Additional .NET Framework data providers will be supported
in future releases. Please see the release bulletin for the latest
information.
Figure 5-1 shows
the general components of an ADO.NET connection using the OLE DB
.NET Framework data provider. If you use the .NET Framework data
provider for SQL Server, the data provider connects directly to
the database.
OLE DB connection
OLE DB data providers
When you use the .NET Framework data provider for OLE DB,
you connect to a database through an OLE DB data provider, such
as Microsoft’s SQLOLEDB or MSDAORA or a data provider from
another vendor.
The .NET Framework Data Provider for OLE DB does not work
with the MSDASQL provider for ODBC, and it does not support OLE
DB version 2.5 interfaces.
You can use any OLE DB data provider that supports the OLE
DB interfaces listed in Table 5-1 with the OLE DB .NET Framework data
provider. For more information about supported providers, see the
topic on .NET Framework data providers in the Microsoft .NET
Framework Developer’s Guide
.
After you install the data provider, you might need to define
a data source for it. To define a data source for one of the OLE
DB data providers shipped with PowerBuilder, use the DataDirect OLE
DB Administrator. This utility is named PBadmin and
can be found in SybaseSharedDataDirect.
OLE DB object | Required interfaces |
---|---|
OLE DB Services | IDataInitialize |
DataSource | IDBInitializeIDBCreateSessionIDBPropertiesIPersist |
Session | ISessionPropertiesIOpenRowset |
Command | ICommandTextICommandProperties |
MultipleResults | IMultipleResults |
RowSet | IRowsetIAccessorIColumnsInfoIRowsetInfo (only required if DBTYPE_HCHAPTER is supported) |
Error | IErrorInfoIErrorRecords |