The IBM.Data.DB2 namespace contains classes that are associated with the DB2® .NET provider. You can use the classes for connecting to a database, executing commands, and retrieving results.
To use the DB2 .NET provider, you must add an imports or using statement for the IBM.Data.DB2 namespace to your application:
[Visual Basic]
Imports IBM.Data.DB2
[C#]
using IBM.Data.DB2;
You also must include a reference to the IBM.Data.DB2.dll file in your application's project. In Visual Studio, you can include this reference by using the References section for your project in Solution Explorer or by clicking Project > Add Reference. If you are compiling a program from the command line, you can specify the IBM® .NET provider file by specifying the following option for the csc or vbc command:
/r:install_dir\bin\netfXX\IBM.Data.IBM.Data.DB2.dll
To establish a connection to one of the supported data servers, you must construct a DB2Connection object and provide it with a valid DB2 .NET connection string. For information about the supported keywords, see DB2Connection.ConnectionString property.
Class | Description |
---|---|
DB2BulkCopy | Facilitates the copying of rows from one data source to another. |
DB2BulkCopyColumnMapping | Represents a column mapping from the data source table to the destination table. |
DB2BulkCopyColumnMappingCollection | Represents a collection of column mappings from the data source table to the destination table. |
DB2Command | Represents an SQL statement or stored procedure to execute against a database. |
DB2CommandBuilder | Automatically generates single-table commands that are used to reconcile changes that are made to the DataSet object. |
DB2Connection | Represents an open connection to a database. |
DB2ConnectionStringBuilder | Facilitates generic and IBM Data Server Provider for .NET-specific approaches to generating valid connection strings. |
DB2DataAdapter | Represents a set of data commands and a connection to a database that are used to fill the DataSet object and update the database. |
DB2DataReader | Provides a way of reading a forward-only stream of data rows from a database. |
DB2DataSourceEnumerator | Provides a way to discover available IBM family data sources. |
DB2Error | Collects a database warning or a database error. |
DB2ErrorCollection | Collects all errors that are generated by the DB2DataAdapter object. |
DB2Exception | Represents exception that is generated when an error is returned by an IBM database server. |
DB2Factory | Represents a set of methods for creating instances of the System.Data.Common data source classes for the data provider. |
DB2InfoMessageEventArgs | Provides data for the InfoMessage event. |
DB2Parameter | Represents a parameter to a DB2Command object and, optionally, its mapping to a DataColumn object. |
DB2ParameterCollection | Represents a collection of parameters that are relevant to a DB2Command object and their mappings to columns in a DataSet object. |
DB2Permission | Enables the IBM Data Server Provider for .NET to ensure that a user has a security level that is adequate to access an IBM database. |
DB2PermissionAttribute | Associates a security action with a custom security attribute. |
DB2Record | Represents a read-only record. |
DB2ResultSet | Provides the ability to scroll through a bindable stream of rows that are returned from a database. You can also insert, update, and delete rows in the DB2ResultSet object. |
DB2RowsCopiedEventArgs | Provides data for the DB2RowsCopied event. |
DB2RowUpdatedEventArgs | Provides data for the RowUpdated event. |
DB2RowUpdatingEventArgs | Provides data for the RowUpdating event. |
DB2Transaction | Represents an SQL transaction. |
DB2UpdatableRecord | Represents a row to be created in a DB2ResultSet object. |
DB2XmlAdapter | Populates the XPathDocument object with data that is retrieved from a database. |
Delegate | Description |
---|---|
DB2InfoMessageEventHandler | Represents the method that handles the InfoMessage event from the DB2Connection object. |
DB2RowsCopiedEventHandler | Represents the method that handles the DB2RowsCopied event from the DB2BulkCopy object. |
DB2RowUpdatedEventHandler | Represents the method that handles the RowUpdated event from the DB2DataAdapter object. |
DB2RowUpdatingEventHandler | Represents the method that handles the RowUpdating event from the DB2DataAdapter object. |
Enumeration | Description |
---|---|
DB2BulkCopyOptions | Specifies options to use with the DB2BulkCopy object. The DB2BulkCopyOptions enumeration consists of bit flags, which you can combine with a bitwise operation. |
DB2CursorType | Specifies cursor options to use with the DB2ResultSet object. The DB2CursorType enumeration consists of bit flags, which you can combine with a bitwise operation. |
DB2ResultSetOptions | Specifies result set options to use with the DB2ResultSet object. The DB2ResultSetOptions enumeration consists of bit flags, which you can combine with a bitwise operation. |
DB2Type | Specifies the data type of a field, property, or DB2Parameter object. |