dotConnect for PostgreSQL Documentation
Devart.Data.PostgreSql Namespace / PgSqlConnection Class / Password Property
Example

On this page
    Password Property (PgSqlConnection)
    On this page
    Gets or sets the user's password to connect.
    Syntax
    'Declaration
     
    Public Property Password As String
    public string Password {get; set;}

    Property Value

    The user's password to connect.
    Remarks
    When a value is assigned to this property, the PgSqlConnection is closed.
    Example
    The following example creates a PgSqlConnection and displays the password.
    public void CreatePgSqlConnection()
    {
      string myConnString = 
          "host=server;database=test;user id=postgres;";
      PgSqlConnection pgSqlConnection = new PgSqlConnection(myConnString);
      pgSqlConnection.Open();
      MessageBox.Show("Password: " + pgSqlConnection.Password.ToString());
      pgSqlConnection.Close();
    }
    Public Sub CreatePgSqlConnection()
      Dim myConnString As String = _
        "host=server;database=test;user id=postgres;"
      Dim pgSqlConnection As New PgSqlConnection(myConnString)
      pgSqlConnection.Open()
      MessageBox.Show("Password: " + pgSqlConnection.Password.ToString())
      pgSqlConnection.Close()
    End Sub
    See Also