Return Value
A new UniConnection object.
Creates a new UniConnection 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() { UniConnection myConnection = new UniConnection("Provider=SQL Server;Data Source=SERVER;Initial Catalog=Northwind;User ID=sa"); UniConnection myConnection2 = (UniConnection)myConnection.Clone(); Console.WriteLine(myConnection2.UserId); }
Public Sub CloneAConnection() Dim myConnection As New UniConnection("Provider=SQL Server;Data Source=SERVER;Initial Catalog=Northwind;User ID=sa") Dim myConnection2 As UniConnection = CType(myConnection.Clone(), UniConnection) Console.WriteLine(myConnection2.UserId) End Sub