共用方式為


ObjectDataSourceView.Insert(IDictionary) 方法

定義

透過呼叫由 InsertMethod 該屬性識別的商業物件方法,使用指定的 values 集合執行插入操作。

public:
 int Insert(System::Collections::IDictionary ^ values);
public int Insert(System.Collections.IDictionary values);
override this.Insert : System.Collections.IDictionary -> int
Public Function Insert (values As IDictionary) As Integer

參數

values
IDictionary

IDictionary一組參數,與屬性一起使用InsertMethod,用於執行插入操作。 若方法無參數,則傳遞 null

傳回

插入的列數;否則,若未知數值,則為 -1。

例外狀況

CanInsert 性質返回 false

備註

預設回傳值為 -1,表示插入了未知數量的列。 若要回傳不同的值,請設定AffectedRows事件物件InsertedObjectDataSourceStatusEventArgs屬性。 受影響的資料列數通常由Insert業務物件的方法回傳,該值可從ReturnValue事件物件Inserted的屬性ObjectDataSourceStatusEventArgs中取得。

該方法呼叫 InsertExecuteInsert 方法,傳遞集合 values

適用於

另請參閱