Return Value
A new DB2Connection object.
Creates a new DB2Connection 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() { DB2Connection db2Connection = new DB2Connection( "user id=db2admin;server=db2;database=SAMPLE;"); DB2Connection db2Connection2 = (DB2Connection)db2Connection.Clone(); Console.WriteLine(db2Connection2.UserId); }
Public Sub CloneAConnection() Dim db2Connection As New DB2Connection( _ "user id=db2admin;server=db2;database=SAMPLE;") Dim db2Connection2 As DB2Connection = CType(db2Connection.Clone(), DB2Connection) Console.WriteLine(db2Connection2.UserId) End Sub