''SqlClientPermissionAttribute'' ''serializable'

SqlClientPermissionAttribute serializable

System.Data.SqlClient (system.data.dll) sealed class

This class allows you to ensure that the current process has the required code access security permission to access the SQL Server provider before executing code that will interact with the database. It also allows you to temporarily revoke this permission. Typically, you apply this attribute to the declaration of a method that accesses the database or to the definition of a class that contains data access code in every method. You can also apply the attribute to an assembly, struct, or constructor. The SqlClientPermissionAttribute provides essentially the same functionality as the SqlClientPermission class, but it allows you to add declarative security code instead of explicit (inline) code.

Note that this attribute pertains only to code access security (the policy of allowed and disallowed actions you have configured using the .NET Framework Configuration Tool). It has nothing to do with the authentication process that SQL Server will use. For more information, refer to the reference for the base class System.Data.Common.DBDataPermissionAttribute . Currently, the only code access security restriction that you can apply to the SQL Server managed provider is denying the permission to use blank passwords in the connection string.

public sealed class SqlClientPermissionAttribute : System.Data.Common.DBDataPermissionAttribute {
// Public Constructors
   public SqlClientPermissionAttribute(System.Security.Permissions.SecurityAction action);
// Public Instance Methods
   public override IPermission CreatePermission(  );             // overrides System.Security.Permissions.SecurityAttribute


System.Object figs/U2192.gif System.Attribute figs/U2192.gif System.Security.Permissions.SecurityAttribute figs/U2192.gif System.Security.Permissions.CodeAccessSecurityAttribute figs/U2192.gif System.Data.Common.DBDataPermissionAttribute figs/U2192.gif SqlClientPermissionAttribute

Valid On

Assembly, Class, Struct, Constructor, Method

    Part I: ADO.NET Tutorial
    Part II: ADO.NET Core Classes
    Part III: API Quick Reference
    Chapter 34. The System.Data Namespace