DataSourceView::ExecuteInsert Method
Performs an insert operation on the list of data that the DataSourceView object represents.
Assembly: System.Web (in System.Web.dll)
Parameters
- values
- Type: System.Collections::IDictionary
An IDictionary of name/value pairs used during an insert operation.
Return Value
Type: System::Int32The number of items that were inserted into the underlying data storage.
| Exception | Condition |
|---|---|
| NotSupportedException | The ExecuteInsert operation is not supported by the DataSourceView. |
Data-bound controls can determine whether the ExecuteInsert operation is supported by a data source control by retrieving the DataSourceView object using the GetView method, and checking the CanInsert property.
The values parameter is a set of name/value pairs that represents data columns or fields and corresponding values to insert.
Note |
|---|
The DataSourceView class's default implementation is to throw a NotSupportedException exception. If you extend the DataSourceView class, override the ExecuteInsert method if your class supports insertion into the underlying data storage. |
The following code example demonstrates how a class that extends the DataSourceView class can override the CanInsert property and the ExecuteInsert method. This code example is part of a larger example provided for the DataSourceView class.
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.
Note