문서를 영문으로 보려면 영문 확인란을 선택하세요. 마우스 포인터를 텍스트 위로 이동시켜 팝업 창에서 영문 텍스트를 표시할 수도 있습니다.
번역
영문

ServerConnection 생성자 (SqlConnection)

Initializes a new instance of the ServerConnection class with the specified connection parameters.

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

public ServerConnection(
	SqlConnection sqlConnection
)

매개 변수

sqlConnection
유형: System.Data.SqlClient.SqlConnection
A SqlConnection system object that specifies connection parameters associated with the referenced connection.

C#

String connectionString = "Data Source=(local);Initial Catalog=AdventureWorks2012;Integrated Security=SSPI;";
SqlConnection sqlConnection = new SqlConnection(connectionString);
ServerConnection conn = new ServerConnection(sqlConnection);
Server srv = new Server(conn);
Console.WriteLine(srv.Information.Version);

PowerShell

$connectionString = "Data Source=(local);Initial Catalog=AdventureWorks2012;Integrated Security=SSPI;"
$sqlConnection = new-object System.Data.SqlClient.SqlConnection($connectionString)
$conn = new-object Microsoft.SqlServer.Management.Common.ServerConnection($sqlConnection)
#Connect to the local, default instance of SQL Server
$srv = new-object Microsoft.SqlServer.Management.Smo.Server($conn)
Write-Host $srv.Information.Version

커뮤니티 추가 항목

추가
표시: