SqlDataSourceView.Insert(IDictionary) 方法

定義

使用 InsertCommand SQL 字串、InsertParameters 集合中指定的任何參數,以及 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 屬性之參數的 InsertCommand,用於執行插入資料庫作業。 如果沒有任何參數與查詢有關聯,或是 InsertCommand 不是參數型的 SQL 查詢,則會傳遞 null

傳回

表示插入基礎資料庫之資料列數的值。

例外狀況

SqlDataSource 不能以基礎資料來源建立連接。

CanInsert 屬性為 false

備註

方法會 Insert 呼叫 ExecuteInsert 方法,並傳遞 values 參數。

適用於

另請參閱