ObjectDataSourceView::Insert Method (IDictionary)
Performs an insert operation by calling the business object method that is identified by the InsertMethod property using the specified values collection.
Assembly: System.Web (in System.Web.dll)
Parameters
- values
- Type: System.Collections::IDictionary
A IDictionary collection of parameters used with the InsertMethod property to perform the insert operation. If there are no parameters associated with the method, pass nullptr.
Return Value
Type: System::Int32The number of rows inserted; otherwise, -1, if the number is not known.
| Exception | Condition |
|---|---|
| NotSupportedException | The CanInsert property returns false. |
The default return value is -1, which means that an unknown number of rows were inserted. To return a different value, set the AffectedRows property of the ObjectDataSourceStatusEventArgs object of the 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 ReturnValue property of the ObjectDataSourceStatusEventArgs object of the Inserted event.
The Insert method calls the ExecuteInsert method, passing the values collection.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.