Bearbeiten

SqlClientPermissionAttribute Class

Definition

Caution

Code Access Security is not supported or honored by the runtime.

Associates a security action with a custom security attribute.

public ref class SqlClientPermissionAttribute sealed : System::Data::Common::DBDataPermissionAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class SqlClientPermissionAttribute : System.Data.Common.DBDataPermissionAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed class SqlClientPermissionAttribute : System.Data.Common.DBDataPermissionAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type SqlClientPermissionAttribute = class
    inherit DBDataPermissionAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type SqlClientPermissionAttribute = class
    inherit DBDataPermissionAttribute
Public NotInheritable Class SqlClientPermissionAttribute
Inherits DBDataPermissionAttribute
Inheritance
Attributes

Remarks

Caution

Code Access Security (CAS) has been deprecated across all versions of .NET Framework and .NET. Recent versions of .NET do not honor CAS annotations and produce errors if CAS-related APIs are used. Developers should seek alternative means of accomplishing security tasks.

Constructors

Name Description
SqlClientPermissionAttribute(SecurityAction)

Initializes a new instance of the SqlClientPermissionAttribute class.

Properties

Name Description
AllowBlankPassword

Gets or sets a value indicating whether a blank password is allowed.

(Inherited from DBDataPermissionAttribute)
ConnectionString

Gets or sets a permitted connection string.

(Inherited from DBDataPermissionAttribute)
KeyRestrictionBehavior

Identifies whether the list of connection string parameters identified by the KeyRestrictions property are the only connection string parameters allowed.

(Inherited from DBDataPermissionAttribute)
KeyRestrictions

Gets or sets connection string parameters that are allowed or disallowed.

(Inherited from DBDataPermissionAttribute)

Methods

Name Description
CreatePermission()

Returns a SqlClientPermission object that is configured according to the attribute properties.

ShouldSerializeConnectionString()

Identifies whether the attribute should serialize the connection string.

(Inherited from DBDataPermissionAttribute)
ShouldSerializeKeyRestrictions()

Identifies whether the attribute should serialize the set of key restrictions.

(Inherited from DBDataPermissionAttribute)

Applies to

See also