ADO.NET Driver Common Components

From InterBase

Go Up to ADO.NET Driver


InterBaseSql.Data.Client.Native

IBClientFactory

Gets an instance to the client library if you need direct access to the API.

GetGDSLibrary This is a static public method to get access to an instance of either the server or embedded InterBase client. Platform/bitness is determined for you. It returns an interface of IIBClient defined an IIBClient.cs. The methods are documented in the InterBaseAPI pdf.

 var ibclient = IBClientFactory.GetGDSLibrary(IBServerType.Default);

InterBaseSql.Data.InterBaseClient

IBCommand

It is a DBCommand descendant, represents an SQL statement or stored procedure to execute against a data source. For information on DBCommand refer to: https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbcommand?view=net-5.0

Constructors

Multiple constructors allowing for optionally setting the command text, connection or transaction.

  1. No params: IBCommand()
  2. One string param: IBCommand(string cmdText)
  3. Two Params, String and IBConnection: IBCommand(string cmdText, IBConnection connection)
  4. Three Params, String, IBConnection, IBTransaction: IBCommand(string cmdText, IBConnection connection, IBTransaction transaction)

CommandPlan

Returns the plan for the currently Prepared SQL. Read only.

Connection

Sets or Gets the IBConnection this command will execute against. Setting is disallowed if there is an active DataReader against this command.

Parameters

Returns the IBParameterCollection for this command.

Transaction

Sets or Gets the IBTransaction this command is to use. If using an implicit transaction the Getter returns NULL. Setting is disallowed if there is an active DataReader.

FetchSize

Sets or Gets the Integer value for how many records to fetch on opening. Setting disallowed if there is an Active DataReader.

Create Parameter

Returns a new IBParameter instance.

ExecuteReader

Accepts 0 or 1 as a parameter. The optional parameter is a CommandBehavior type. No parameters uses the Default. This executes the command and returns a new IBDataReader against the results.

IBCommandBuilder

A DbCommandBuilder descendant. It automatically generates single-table commands used to reconcile changes made to a DataSet with the associated database. For information on DbCommandBuilder refer to: https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbcommandbuilder?view=net-5.0

Constructor

Accepts 0 or 1 as a parameter, the optional parameter is an IBDataAdapter to use.

DeriveParameters It is a static method for determining the parameters of a Stored Procedure only. Accepts IBCommand as input and when done the IBCommand’s Parameters will reflect the SP’s parameters.

DataAdapter

Gets or Sets the IBDataAdapter to use.

Note: All of the following GetXxxxCommand come in 2 forms. No Parameters or an optional Boolean that when set to true uses the column for parameter names.

GetInsertCommand

Returns the INSERT SQL in the form of an IBCommand.

GetUpdateCommand

Returns the UPDATE SQL in the form of an IBCommand.

GetDeleteCommand

Returns the DELETE SQL in the form of an IBCommand.

IBConnection

A DbConnection descendant. Defines the core behavior of database connections. Works from a connection string (see below). For information on DbConnection refer to: https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbconnection?view=net-5.0

Constructors

0 or 1 parameters. The single parameter version takes a connection string and associates it with the newly created IBConnection.

ClearAllPools

Clears all the pools in the IBConnectionManager.

ClearPool

Accepts a single IBConnection and clears all instances using that IBConnection’s connection string.

ClearPool

Accepts a single string and clears all instances that use that connection string.

Static CreateDatabase

Accepts a connection string and an overwrite Boolean. Creates a new database based on the connection string. If overwrite is false fails if the DB already exists.

Static CreateDatabase

Accepts up to 4 inputs to create a new database:

  1. A connection string
  2. A page size (default 4096)
  3. Whether Forced writes (Sync mode) is on (default true)
  4. Whether to overwrite an existing DB file (default false)

Static DropDatabase

Drops (deletes) the database identified by the passed connection string.

PacketSize

Returns the packet size used in communicating with the server. Read Only.

Note: All Transaction methods have an optional transaction name that can be passed at the end of the parameter list when using save points.

BeginTransaction

Starts a Transaction and returns the IBTransaction. Several flavors

  1. 0 Parameters starts a ReadCommitted transaction
  2. 1 IsolationLevel param Starts a transaction based on the isolation level passed.
  3. 1 IBTransactionOptions – starts a transaction based on the options passed.

CreateCommand

Returns a new IBCommand to use with this connection.

ChangeDatabase

Accepts a new connection string and switches this connection to use the new information. If an exception is raised in connecting the old string is restored.

IBConnectionStringBuilder

A . It can be used to create a connection string from the individual parts. For information on DbConnectionStringBuilder decendant refer to: https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbconnectionstringbuilder?view=net-5.0 Details on connection strings properties below.

Constructor

Two forms, no parameters or a connection string that will get parsed into its pieces.

IBDataAdapter

A DbDataAdapter descendant. This implements a set of functions to provide strong typing, but inherit most of the functionality needed to fully implement a DataAdapter. For information on DbDataAdapter refer to: https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbdataadapter?view=net-5.0

IBDatabaseInfo

Class that given a connection allows for retrieving information on that database.

Properties

IBConnection

The connection component to use to query against.

IscVersion

PageSize

AllocationPages

BaseLevel

DbId

Implementation

NoReserve

OdsVersion

OdsMinorVersion

MaxMemory

CurrentMemory

ForcedWrites

NumBuffers

SweepInterval

ReadOnly

Fetches

Marks

Reads

Writes

BackoutCount

DeleteCount

ExpungeCount

InsertCount

PurgeCount

ReadIdxCount

ReadSeqCount

UpdateCount

DatabaseSizeInPages

ActiveUsers

IBDataReader

A descendant. This is a forward only stream of rows from a data source. For information on DbDataReader refer to: https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbdatareader?view=net-5.0

IBEnlistmentNotification

implementation. For information on IEnlistmentNotification refer to: https://docs.microsoft.com/en-us/dotnet/api/system.transactions.ienlistmentnotification?view=net-5.0

IBTransaction

DbTransaction descendant. Transaction component for transaction control. For information on DbTransaction refer to: https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbtransaction?view=net-5.0

InterBaseClientFactory

A DbProviderFactory descendant. This represents a set of methods for creating instances of a provider's implementation of the data source classes. For information on DbProviderFactory refer to: https://docs.microsoft.com/en-us/dotnet/api/system.data.common.dbproviderfactory?view=net-5.0

Advance To: