DataConnectionProperties.AddProperty Method (String, Type, [])

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

'宣言
Protected Function AddProperty ( _
    name As String, _
    type As Type, _
    ParamArray attributes As Attribute() _
) As PropertyDescriptor
'使用
Dim name As String
Dim type As Type
Dim attributes As Attribute()
Dim returnValue As PropertyDescriptor

returnValue = Me.AddProperty(name, _
    type, attributes)
protected PropertyDescriptor AddProperty(
    string name,
    Type type,
    params Attribute[] attributes
)
protected:
PropertyDescriptor^ AddProperty(
    String^ name, 
    Type^ type, 
    ... array<Attribute^>^ attributes
)
protected function AddProperty(
    name : String, 
    type : Type, 
    ... attributes : Attribute[]
) : PropertyDescriptor

Parameters

  • type
    Type: System.Type

    The data type of the property.

  • attributes
    Type: []

    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.

Permissions

See Also

Reference

DataConnectionProperties Class

DataConnectionProperties Members

AddProperty Overload

Microsoft.VisualStudio.Data Namespace

RemoveProperty