共用方式為


AdoDotNetConnectionProperties.Add 方法 (String, Type, Object)

將新屬性加入至目前連接屬性集合。

命名空間:  Microsoft.VisualStudio.Data.Framework.AdoDotNet
組件:  Microsoft.VisualStudio.Data.Framework (在 Microsoft.VisualStudio.Data.Framework.dll 中)

語法

'宣告
Public Overridable Sub Add ( _
    key As String, _
    type As Type, _
    value As Object _
)
public virtual void Add(
    string key,
    Type type,
    Object value
)
public:
virtual void Add(
    String^ key, 
    Type^ type, 
    Object^ value
)
abstract Add : 
        key:string * 
        type:Type * 
        value:Object -> unit 
override Add : 
        key:string * 
        type:Type * 
        value:Object -> unit 
public function Add(
    key : String, 
    type : Type, 
    value : Object
)

參數

  • type
    型別:System.Type
    要加入之屬性的型別。

實作

IVsDataConnectionProperties.Add(String, Type, Object)

例外狀況

例外狀況 條件
ArgumentNullException

propertyName 參數為 nullNull 參照 (即 Visual Basic 中的 Nothing)。

NotSupportedException

連接字串不是可擴充的。

ArgumentException

屬性已存在。

.NET Framework 安全性

請參閱

參考

AdoDotNetConnectionProperties 類別

Add 多載

Microsoft.VisualStudio.Data.Framework.AdoDotNet 命名空間