IDbConnection 接口

Represents an open connection to a data source, and is implemented by SQL Server Reporting Services data processing extensions that access relational databases.

命名空间:  Microsoft.ReportingServices.DataProcessing
程序集:  Microsoft.ReportingServices.Interfaces(在 Microsoft.ReportingServices.Interfaces.dll 中)

语法

声明
Public Interface IDbConnection _
    Inherits IDisposable, IExtension
用法
Dim instance As IDbConnection
public interface IDbConnection : IDisposable, 
    IExtension
public interface class IDbConnection : IDisposable, 
    IExtension
type IDbConnection =  
    interface
        interface IDisposable
        interface IExtension
    end
public interface IDbConnection extends IDisposable, IExtension

IDbConnection 类型公开以下成员。

属性

  名称 说明
公共属性 ConnectionString Gets or sets the string used to open a database.
公共属性 ConnectionTimeout Gets the time to wait, while trying to establish a connection, before terminating the attempt and generating an error.
公共属性 LocalizedName Gets the localized name of the extension to be displayed in a user interface. (从 IExtension 继承。)

页首

方法

  名称 说明
公共方法 BeginTransaction Begins a database transaction.
公共方法 Close Closes the connection to the database.
公共方法 CreateCommand Creates and returns a Command object associated with the connection.
公共方法 Dispose (从 IDisposable 继承。)
公共方法 Open Initializes a database connection with the settings specified by the ConnectionString property of the provider-specific Connection object.
公共方法 SetConfiguration Used to pass custom configuration data to an extension. (从 IExtension 继承。)

页首

注释

The IDbConnection interface enables you to implement a Connection class, which represents a unique session with a data source. The IDbConnection interface can be used to build a custom data provider. For more information about Connection classes, see 为数据处理扩展插件实现 Connection 类.

An application does not create an instance of the IDbConnection interface directly, but creates an instance of a class that implements IDbConnection.

Classes that implement IDbConnection must implement all required members, and typically define additional members to add provider-specific functionality. Because IDbConnection inherits from IExtension, you must also implement the IExtension members as part of your Connection class.

When you implement from the IDbConnection interface, you should also implement the following constructors:

Class

Description

PrvConnection()

Initializes a new instance of the PrvConnection class.

PrvConnection(string connectionString)

Initializes a new instance of the PrvConnection class when given a string containing the connection string.