DekGenius.com
[ Team LiB ] Previous Section Next Section

DBDataPermissionAttribute serializable

System.Data.Common (system.data.dll) abstract class

Provider-specific attributes that derive from this class identify custom security attributes for certain actions. This is how it works: by default, .NET code has full access to attempt any actions using managed providers. However, using the .NET Framework Configuration tool (installed to the Administrative Tools group), you can modify these permissions. 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 that managed OLE DB provider can use. (These settings are translated to specific entries in the machine.config file for your computer.) If you use impose these restrictions, you may want to identify an area of your code that requires a certain permission (such as the ability to use a blank password). You identify these areas using an attribute derived from DBDataPermissionAttribute . By identifying these areas, you ensure only one thing: if the required privilege isn't allowed, an exception will be thrown before .NET attempts to run the identified code.

You can apply an attribute derived from DBDataPermissionAttribute to an assembly, class, struct, constructor, or method.

public abstract class DBDataPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute {
// Protected Constructors
   protected DBDataPermissionAttribute(System.Security.Permissions.SecurityAction action);
// Public Instance Properties
   public bool AllowBlankPassword{set; get; } 
   public string ConnectionString{set; get; } 
   public KeyRestrictionBehavior KeyRestrictionBehavior{set; get; } 
   public string KeyRestrictions{set; get; } 
}

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 DBDataPermissionAttribute

Subclasses

System.Data.OleDb.OleDbPermissionAttribute , System.Data.SqlClient.SqlClientPermissionAttribute

Passed To

DBDataPermission.DBDataPermission( )

Valid On

Assembly, Class, Struct, Constructor, Method

    [ Team LiB ] Previous Section Next Section