ServerConnection.Copy Método
Devuelve una copia del objeto ServerConnection.
Espacio de nombres: Microsoft.SqlServer.Management.Common
Ensamblado: Microsoft.SqlServer.ConnectionInfo (en Microsoft.SqlServer.ConnectionInfo.dll)
Sintaxis
'Declaración
Public Function Copy As ServerConnection
'Uso
Dim instance As ServerConnection
Dim returnValue As ServerConnection
returnValue = instance.Copy()
public ServerConnection Copy()
public:
ServerConnection^ Copy()
member Copy : unit -> ServerConnection
public function Copy() : ServerConnection
Valor devuelto
Tipo: Microsoft.SqlServer.Management.Common.ServerConnection
Objeto ServerConnection que es una copia del objeto ServerConnection al que se hace referencia.
Ejemplos
C#
ServerConnection conn = new ServerConnection();
conn.LoginSecure = false;
conn.Login = vlogin;
conn.password = vpassword;
ServerConnection conn2 = conn.Copy()
conn2.StatementTimeout = 450;
Console.WriteLine(conn2.StatementTimeout);
Console.WriteLine(conn.StatementTimeout);
PowerShell
$conn = new-object Microsoft.SqlServer.Management.Common.ServerConnection
$conn.LoginSecure = $FALSE
$conn.Login = vlogin
$conn.Password = vpassword
$conn2 = $conn.Copy()
$conn2.StatementTimeout = 450
Write-Host $conn2.StatementTimeout
Write-Host $conn.StatementTimeout
Vea también
Referencia
Espacio de nombres Microsoft.SqlServer.Management.Common