共用方式為


DatabaseUtils.InsertHelper.Insert(ContentValues) Method

Definition

Caution

deprecated

Performs an insert, adding a new row with the given values.

[Android.Runtime.Register("insert", "(Landroid/content/ContentValues;)J", "GetInsert_Landroid_content_ContentValues_Handler")]
[System.Obsolete("deprecated")]
public virtual long Insert (Android.Content.ContentValues values);
[<Android.Runtime.Register("insert", "(Landroid/content/ContentValues;)J", "GetInsert_Landroid_content_ContentValues_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member Insert : Android.Content.ContentValues -> int64
override this.Insert : Android.Content.ContentValues -> int64

Parameters

values
ContentValues

the set of values with which to populate the new row

Returns

the row ID of the newly inserted row, or -1 if an error occurred

Attributes

Remarks

Performs an insert, adding a new row with the given values. If the table contains conflicting rows, an error is returned.

Java documentation for android.database.DatabaseUtils.InsertHelper.insert(android.content.ContentValues).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to