다음을 통해 공유


ServerConnection.Copy 메서드

Returns a copy of the ServerConnection object.

네임스페이스:  Microsoft.SqlServer.Management.Common
어셈블리:  Microsoft.SqlServer.ConnectionInfo(Microsoft.SqlServer.ConnectionInfo.dll)

구문

‘선언
Public Function Copy As ServerConnection
‘사용 방법
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

반환 값

유형: Microsoft.SqlServer.Management.Common.ServerConnection
A ServerConnection object that is a copy of the referenced ServerConnection object.

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

참고 항목

참조

ServerConnection 클래스

Microsoft.SqlServer.Management.Common 네임스페이스

관련 자료

메서드 호출