Export (0) Print
Expand All

SqlClientPermission Class

Enables the .NET Framework Data Provider for SQL Server to help make sure that a user has a security level sufficient to access a data source.

Namespace: System.Data.SqlClient
Assembly: System.Data (in system.data.dll)

[SerializableAttribute] 
public sealed class SqlClientPermission : DBDataPermission
/** @attribute SerializableAttribute() */ 
public final class SqlClientPermission extends DBDataPermission
SerializableAttribute 
public final class SqlClientPermission extends DBDataPermission
Not applicable.

The IsUnrestricted property takes precedence over the AllowBlankPassword property. Therefore, if you set AllowBlankPassword to false, you must also set IsUnrestricted to false to prevent a user from making a connection using a blank password.

NoteNote:

When using code access security permissions for ADO.NET, the correct pattern is to start with the most restrictive case (no permissions at all) and then add the specific permissions that are needed for the particular task that the code needs to perform. The opposite pattern, starting with all permissions and then denying a specific permission, is not secure, because there are many ways of expressing the same connection string. For example, if you start with all permissions and then attempt to deny the use of the connection string "server=someserver", the string "server=someserver.mycompany.com" would still be allowed. By always starting by granting no permissions at all, you reduce the chances that there are holes in the permission set.

System.Object
   System.Security.CodeAccessPermission
     System.Data.Common.DBDataPermission
      System.Data.SqlClient.SqlClientPermission

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft