Share via


Connection.UserName Property

Definition

Gets the Windows domain or local account name for the user.

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

Property Value

The Windows domain or local account name of the user whose credentials are being used in this connection.

Examples

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

Applies to