Compartir a través de


DataConnectionProperties.AddProperty Method (String, Type, array<Attribute )

Dynamically adds a new property to the collection of properties natively recognized by this data connection properties instance.

Namespace:  Microsoft.VisualStudio.Data
Assembly:  Microsoft.VisualStudio.Data (in Microsoft.VisualStudio.Data.dll)

Syntax

'Declaration
Protected Function AddProperty ( _
    name As String, _
    type As Type, _
    ParamArray attributes As Attribute() _
) As PropertyDescriptor
protected PropertyDescriptor AddProperty(
    string name,
    Type type,
    params Attribute[] attributes
)
protected:
PropertyDescriptor^ AddProperty(
    String^ name, 
    Type^ type, 
    ... array<Attribute^>^ attributes
)
member AddProperty : 
        name:string * 
        type:Type * 
        attributes:Attribute[] -> PropertyDescriptor
protected function AddProperty(
    name : String, 
    type : Type, 
    ... attributes : Attribute[]
) : PropertyDescriptor

Parameters

  • type
    Type: System.Type

    The data type of the property.

  • attributes
    Type: array<System.Attribute[]

    A set of attributes to attach to the property.

Return Value

Type: System.ComponentModel.PropertyDescriptor
The descriptor of the newly added property.

Exceptions

Exception Condition
ArgumentNullException

The name and/or type parameters are null.

InvalidOperationException

The specified property already exists.

.NET Framework Security

See Also

Reference

DataConnectionProperties Class

AddProperty Overload

Microsoft.VisualStudio.Data Namespace

RemoveProperty