''SqlClientPermission'' ''serializable'

SqlClientPermission serializable

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

With this class, you can ensure that the current process has the required code access security permission to access the SQL Server provider before you attempt to open a connection. If it doesn't, a System.Security.SecurityException will be thrown. You can also use this class to programmatically revoke the permission to access the SQL Server provider for the current method call.

This class pertains only to code access security (the policy of allowed and disallowed actions you have configured using the .NET Framework Configuration Tool or the caspol.exe command-line utility). It has nothing to do with the authentication process SQL Server uses. For more information, refer to the reference for the base class System.Data.Common.DBDataPermission . Currently, the only code access security restriction you can apply to the SQL Server data provider is denying permission to use blank passwords in the connection string.

public sealed class SqlClientPermission : System.Data.Common.DBDataPermission {
// Public Constructors
   public SqlClientPermission(  );  
   public SqlClientPermission(System.Security.Permissions.PermissionState state);
   public SqlClientPermission(System.Security.Permissions.PermissionState state, bool allowBlankPassword);
// Public Instance Methods
   public override void Add(string connectionString, string restrictions, System.Data.KeyRestrictionBehavior behavior);          
// overrides System.Data.Common.DBDataPermission
   public override IPermission Copy(  );                         // overrides System.Data.Common.DBDataPermission


System.Object figs/U2192.gif System.Security.CodeAccessPermission(System.Security.IPermission, System.Security.ISecurityEncodable , System.Security.IStackWalk) figs/U2192.gif System.Data.Common.DBDataPermission(System.Security.Permissions.IUnrestrictedPermission) figs/U2192.gif SqlClientPermission

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