Server.ConnectionContext Property

Gets the current server connection details for the instance of Microsoft SQL Server.

Namespace: Microsoft.SqlServer.Management.Smo
Assembly: Microsoft.SqlServer.Smo (in microsoft.sqlserver.smo.dll)

public ServerConnection ConnectionContext { get; }
/** @property */
public ServerConnection get_ConnectionContext ()

public function get ConnectionContext () : ServerConnection

Property Value

A ServerConnection object that specifies the details of the current connection to the instance of SQL Server.

Updated text:

Updated text:

This property can be used to change connection settings, such as the name of the instance of SQL Server or the authentication type. The ConnectionContext property is represented by the ServerConnection class. When connecting to the local instance of SQL Server by using Windows authentication, the default values are used. You do not have to set any properties.

This namespace, class, or member is supported only in version 2.0 of the Microsoft .NET Framework.

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server 2005.

Target Platforms



New content:
  • Added code sample to the Example section.

  • Added to the description in the Remarks section.



New content:
  • Added text to the ConnectionContext Remarks section.

Community Additions