This documentation is archived and is not being maintained.

DBDataPermission.Add Method

Adds access for the specified connection string to the existing state of the DBDataPermission.

Namespace:  System.Data.Common
Assembly:  System.Data (in System.Data.dll)

public virtual void Add(
	string connectionString,
	string restrictions,
	KeyRestrictionBehavior behavior


Type: System.String
A permitted connection string.
Type: System.String
String that identifies connection string parameters that are allowed or disallowed.
Type: System.Data.KeyRestrictionBehavior
One of the KeyRestrictionBehavior properties.

This method can be useful when implementing:

  • A .NET framework data provider.

  • An API that must assert for data access permission.

  • An administrative tool or installation program that must modify security policy.

  • When more than one rule is specified, the more restrictive rule is selected.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.