Share via


Connection.Name Property

Definition

Gets the name of the current connection.

public:
 property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String

Property Value

The name of the current connection.

Examples

public string conName(IServiceProvider sp) {
    Connection con = (Connection)sp.GetService(typeof(Connection));
    return con.Name;
}

Remarks

For a server, the value of the Name property will be the server name. For a site, the value will be the site name. For an application, the value will be the application name.

Note

When the Name property is accessed at the application or site level under a server connection, the property returns the name of the server.

Applies to