Return Value
A new PgSqlConnection object.
Creates a new PgSqlConnection object with the properties that have the same values as those of the original object. However, changing properties of the new object has no influence on the values of the same properties of the original object.
Note that state of the new instance is always Closed, regardless of the state of original instance.
public void CloneAConnection() { PgSqlConnection pgConnection = new PgSqlConnection( "host=server;database=test;user id=postgres;"); PgSqlConnection pgConnection2 = (PgSqlConnection)pgConnection.Clone(); Console.WriteLine(pgConnection2.UserId); }
Public Sub CloneAConnection() Dim pgConnection As New PgSqlConnection( _ "host=server;database=test;user id=postgres;") Dim pgConnection2 As PgSqlConnection = CType(pgConnection.Clone(), PgSqlConnection) Console.WriteLine(pgConnection2.UserId) End Sub