[ Team LiB ] Previous Section Next Section

OleDbPermissionAttribute serializable

System.Data.OleDb (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 OLE DB provider before executing code that interacts 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 OleDbPermissionAttribute provides essentially the same functionality as the OleDbPermission 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). For more information, refer to the reference for the base class System.Data.Common.DBDataPermissionAttribute . Currently, there are only two additional restrictions you can impose: denying the right to use blank passwords in a connection string and restricting the allowed OLE DB drivers.

public sealed class OleDbPermissionAttribute : System.Data.Common.DBDataPermissionAttribute {
// Public Constructors
   public OleDbPermissionAttribute(System.Security.Permissions.SecurityAction action);
// Public Instance Properties
   public string Provider{set; get; } 
// Public Instance Methods
   public override IPermission CreatePermission(  );             // overrides System.Security.Permissions.SecurityAttribute
}

Hierarchy

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 OleDbPermissionAttribute

Valid On

Assembly, Class, Struct, Constructor, Method

    [ Team LiB ] Previous Section Next Section