Npgsql API Docs

NpgsqlConnection Class

This class represents a connection to a PostgreSQL server.

For a list of all members of this type, see NpgsqlConnection Members.

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         Npgsql.NpgsqlConnection

[Visual Basic]
NotInheritable Public Class NpgsqlConnection
    Inherits Component
    Implements IDbConnection, ICloneable
[C#]
public sealed class NpgsqlConnection : Component, IDbConnection, ICloneable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

NpgsqlConnection accepts connection to Postgresql servers 7.x and above. The following connection string keys are available:
Valid values are:
Server: Address/Name of Postgresql Server; Port: Port to connect to; Protocol: Protocol version to use, instead of automatic; Integer 2 or 3; Database: Database name. Defaults to user name if not specified; User Id: User name; Password: Password for clear text authentication; SSL: True or False. Controls whether to attempt a secure connection. Default = False; Pooling: True or False. Controls whether connection pooling is used. Default = True; MinPoolSize: Min size of connection pool; MaxPoolSize: Max size of connection pool; Encoding: Encoding to be used; Timeout: Time to wait for connection open in seconds. Sslmode: Mode for ssl connection control.

Requirements

Namespace: Npgsql

Assembly: Npgsql (in Npgsql.dll)

See Also

NpgsqlConnection Members | Npgsql Namespace