C# 클래스 Npgsql.NpgsqlConnection

상속: System.Data.Common.DbConnection, ICloneable
파일 보기 프로젝트 열기: undeadlabs/Npgsql 1 사용 예제들

Private Properties

프로퍼티 타입 설명
CheckConnectionClosed void
CheckConnectionOpen void
CheckNotDisposed void
CopyConnectionStringBuilder NpgsqlConnectionStringBuilder
DefaultCertificateSelectionCallback System.Security.Cryptography.X509Certificates.X509Certificate
DefaultCertificateValidationCallback bool
DefaultPrivateKeySelectionCallback System.Security.Cryptography.AsymmetricAlgorithm
DefaultProvideClientCertificatesCallback void
DefaultValidateRemoteCertificateCallback bool
EmergencyClose void
ICloneable Object
Init void
LoadConnectionStringBuilder void
LoadConnectionStringBuilder void
LogConnectionString void
OnNotice void
OnNotification void
PromotableLocalTransactionEnded void
ReallyClose void
RefreshConnectionString void

공개 메소드들

메소드 설명
BeginTransaction ( ) : NpgsqlTransaction

Begins a database transaction.

Currently there's no support for nested transactions.

BeginTransaction ( System.Data.IsolationLevel level ) : NpgsqlTransaction

Begins a database transaction with the specified isolation level.

Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. There's no support for nested transactions.

ChangeDatabase ( String dbName ) : void

This method changes the current database by disconnecting from the actual database and connecting to the specified.

ClearAllPools ( ) : void

Clear all connection pools.

ClearPool ( ) : void

Clear connection pool.

Clone ( ) : NpgsqlConnection

Create a new connection based on this one.

Close ( ) : void

Releases the connection to the database. If the connection is pooled, it will be made available for re-use. If it is non-pooled, the actual connection will be shutdown.

CreateCommand ( ) : NpgsqlCommand

Creates and returns a NpgsqlCommand object associated with the NpgsqlConnection.

EnlistTransaction ( Transaction transaction ) : void

Enlist transation.

GetSchema ( ) : DataTable

Returns the supported collections

GetSchema ( string collectionName ) : DataTable

Returns the schema collection specified by the collection name.

GetSchema ( string collectionName, string restrictions ) : DataTable

Returns the schema collection specified by the collection name filtered by the restrictions.

NpgsqlConnection ( ) : System

Initializes a new instance of the NpgsqlConnection class.

NpgsqlConnection ( NpgsqlConnectionStringBuilder ConnectionString ) : System

Initializes a new instance of the NpgsqlConnection class and sets the ConnectionString.

NpgsqlConnection ( String ConnectionString ) : System

Initializes a new instance of the NpgsqlConnection class and sets the ConnectionString.

Open ( ) : void

Opens a database connection with the property settings specified by the ConnectionString.

보호된 메소드들

메소드 설명
BeginDbTransaction ( System.Data.IsolationLevel isolationLevel ) : DbTransaction

Begins a database transaction with the specified isolation level.

Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. There's no support for nested transactions.

CreateDbCommand ( ) : DbCommand

Creates and returns a DbCommand object associated with the IDbConnection.

Dispose ( bool disposing ) : void

Releases all resources used by the NpgsqlConnection.

비공개 메소드들

메소드 설명
CheckConnectionClosed ( ) : void
CheckConnectionOpen ( ) : void
CheckNotDisposed ( ) : void
CopyConnectionStringBuilder ( ) : NpgsqlConnectionStringBuilder

Returns a copy of the NpgsqlConnectionStringBuilder that contains the parsed connection string values.

DefaultCertificateSelectionCallback ( X509CertificateCollection clientCertificates, X509Certificate serverCertificate, string targetHost, X509CertificateCollection serverRequestedCertificates ) : X509Certificate

Default SSL CertificateSelectionCallback implementation.

DefaultCertificateValidationCallback ( X509Certificate certificate, int certificateErrors ) : bool

Default SSL CertificateValidationCallback implementation.

DefaultPrivateKeySelectionCallback ( X509Certificate certificate, string targetHost ) : AsymmetricAlgorithm

Default SSL PrivateKeySelectionCallback implementation.

DefaultProvideClientCertificatesCallback ( X509CertificateCollection certificates ) : void

Default SSL ProvideClientCertificatesCallback implementation.

DefaultValidateRemoteCertificateCallback ( X509Certificate cert, X509Chain chain, SslPolicyErrors errors ) : bool

Default SSL ValidateRemoteCertificateCallback implementation.

EmergencyClose ( ) : void
ICloneable ( ) : Object

Create a new connection based on this one.

Init ( ) : void
LoadConnectionStringBuilder ( NpgsqlConnectionStringBuilder connectionString ) : void

Sets the `settings` ConnectionStringBuilder based on the given `connectionString`

LoadConnectionStringBuilder ( string connectionString ) : void

Sets the `settings` ConnectionStringBuilder based on the given `connectionString`

LogConnectionString ( ) : void

Write each key/value pair in the connection string to the log.

OnNotice ( object O, Npgsql.NpgsqlNoticeEventArgs E ) : void
OnNotification ( object O, Npgsql.NpgsqlNotificationEventArgs E ) : void
PromotableLocalTransactionEnded ( ) : void

When a connection is closed within an enclosing TransactionScope and the transaction hasn't been promoted, we defer the actual closing until the scope ends.

ReallyClose ( ) : void
RefreshConnectionString ( ) : void

Refresh the cached _connectionString whenever the builder settings change

메소드 상세

BeginDbTransaction() 보호된 메소드

Begins a database transaction with the specified isolation level.
Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. There's no support for nested transactions.
protected BeginDbTransaction ( System.Data.IsolationLevel isolationLevel ) : DbTransaction
isolationLevel System.Data.IsolationLevel The isolation level under which the transaction should run.
리턴 System.Data.Common.DbTransaction

BeginTransaction() 공개 메소드

Begins a database transaction.
Currently there's no support for nested transactions.
public BeginTransaction ( ) : NpgsqlTransaction
리턴 NpgsqlTransaction

BeginTransaction() 공개 메소드

Begins a database transaction with the specified isolation level.
Currently the IsolationLevel ReadCommitted and Serializable are supported by the PostgreSQL backend. There's no support for nested transactions.
public BeginTransaction ( System.Data.IsolationLevel level ) : NpgsqlTransaction
level System.Data.IsolationLevel The isolation level under which the transaction should run.
리턴 NpgsqlTransaction

ChangeDatabase() 공개 메소드

This method changes the current database by disconnecting from the actual database and connecting to the specified.
public ChangeDatabase ( String dbName ) : void
dbName String The name of the database to use in place of the current database.
리턴 void

ClearAllPools() 공개 정적인 메소드

Clear all connection pools.
public static ClearAllPools ( ) : void
리턴 void

ClearPool() 공개 메소드

Clear connection pool.
public ClearPool ( ) : void
리턴 void

Clone() 공개 메소드

Create a new connection based on this one.
public Clone ( ) : NpgsqlConnection
리턴 NpgsqlConnection

Close() 공개 메소드

Releases the connection to the database. If the connection is pooled, it will be made available for re-use. If it is non-pooled, the actual connection will be shutdown.
public Close ( ) : void
리턴 void

CreateCommand() 공개 메소드

Creates and returns a NpgsqlCommand object associated with the NpgsqlConnection.
public CreateCommand ( ) : NpgsqlCommand
리턴 NpgsqlCommand

CreateDbCommand() 보호된 메소드

Creates and returns a DbCommand object associated with the IDbConnection.
protected CreateDbCommand ( ) : DbCommand
리턴 System.Data.Common.DbCommand

Dispose() 보호된 메소드

Releases all resources used by the NpgsqlConnection.
protected Dispose ( bool disposing ) : void
disposing bool true when called from Dispose(); /// false when being called from the finalizer.
리턴 void

EnlistTransaction() 공개 메소드

Enlist transation.
public EnlistTransaction ( Transaction transaction ) : void
transaction System.Transactions.Transaction
리턴 void

GetSchema() 공개 메소드

Returns the supported collections
public GetSchema ( ) : DataTable
리턴 System.Data.DataTable

GetSchema() 공개 메소드

Returns the schema collection specified by the collection name.
public GetSchema ( string collectionName ) : DataTable
collectionName string The collection name.
리턴 System.Data.DataTable

GetSchema() 공개 메소드

Returns the schema collection specified by the collection name filtered by the restrictions.
public GetSchema ( string collectionName, string restrictions ) : DataTable
collectionName string The collection name.
restrictions string /// The restriction values to filter the results. A description of the restrictions is contained /// in the Restrictions collection. ///
리턴 System.Data.DataTable

NpgsqlConnection() 공개 메소드

Initializes a new instance of the NpgsqlConnection class.
public NpgsqlConnection ( ) : System
리턴 System

NpgsqlConnection() 공개 메소드

Initializes a new instance of the NpgsqlConnection class and sets the ConnectionString.
public NpgsqlConnection ( NpgsqlConnectionStringBuilder ConnectionString ) : System
ConnectionString NpgsqlConnectionStringBuilder The connection used to open the PostgreSQL database.
리턴 System

NpgsqlConnection() 공개 메소드

Initializes a new instance of the NpgsqlConnection class and sets the ConnectionString.
public NpgsqlConnection ( String ConnectionString ) : System
ConnectionString String The connection used to open the PostgreSQL database.
리턴 System

Open() 공개 메소드

Opens a database connection with the property settings specified by the ConnectionString.
public Open ( ) : void
리턴 void