Performs an insert operation by calling the business object method that is identified by the ObjectDataSourceView.InsertMethod property using the specified values collection.
- values
- A IDictionary collection of parameters used with the ObjectDataSourceView.InsertMethod property to perform the insert operation. If there are no parameters associated with the method, pass null.
The number of rows inserted; otherwise, -1, if the number is not known.
The default return value is -1, which means that an unknown number of rows were inserted. To return a different value, set the ObjectDataSourceStatusEventArgs.AffectedRows property of the System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs object of the ObjectDataSource.Inserted event. The number of affected rows is typically returned by the Insert method for the business object, and that value is available from the ObjectDataSourceStatusEventArgs.ReturnValue property of the System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs object of the ObjectDataSource.Inserted event.
The ObjectDataSourceView.Insert(IDictionary) method calls the ObjectDataSourceView.ExecuteInsert(IDictionary) method, passing the values collection.