Export (0) Print
Expand All

DataSourceView Class

Serves as the base class for all data source view classes, which define the capabilities of data source controls.

Namespace:  System.Web.UI
Assembly:  System.Web (in System.Web.dll)

[<AbstractClass>]
type DataSourceView =  class end

The DataSourceView type exposes the following members.

  NameDescription
Protected methodDataSourceViewInitializes a new instance of the DataSourceView class.
Top

  NameDescription
Public propertyCanDeleteGets a value indicating whether the DataSourceView object associated with the current DataSourceControl object supports the ExecuteDelete operation.
Public propertyCanInsertGets a value indicating whether the DataSourceView object associated with the current DataSourceControl object supports the ExecuteInsert operation.
Public propertyCanPageGets a value indicating whether the DataSourceView object associated with the current DataSourceControl object supports paging through the data retrieved by the ExecuteSelect method.
Public propertyCanRetrieveTotalRowCountGets a value indicating whether the DataSourceView object associated with the current DataSourceControl object supports retrieving the total number of data rows, instead of the data.
Public propertyCanSortGets a value indicating whether the DataSourceView object associated with the current DataSourceControl object supports a sorted view on the underlying data source.
Public propertyCanUpdateGets a value indicating whether the DataSourceView object associated with the current DataSourceControl object supports the ExecuteUpdate operation.
Protected propertyEventsGets a list of event-handler delegates for the data source view.
Public propertyNameGets the name of the data source view.
Top

  NameDescription
Public methodCanExecuteDetermines whether the specified command can be executed.
Public methodDeletePerforms an asynchronous delete operation on the list of data that the DataSourceView object represents.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodExecuteCommand(String, IDictionary, IDictionary)Executes the specified command.
Public methodExecuteCommand(String, IDictionary, IDictionary, DataSourceViewOperationCallback)Executes the specified command.
Protected methodExecuteDeletePerforms a delete operation on the list of data that the DataSourceView object represents.
Protected methodExecuteInsertPerforms an insert operation on the list of data that the DataSourceView object represents.
Protected methodExecuteSelectGets a list of data from the underlying data storage.
Protected methodExecuteUpdatePerforms an update operation on the list of data that the DataSourceView object represents.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodInsertPerforms an asynchronous insert operation on the list of data that the DataSourceView object represents.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnDataSourceViewChangedRaises the DataSourceViewChanged event.
Protected methodRaiseUnsupportedCapabilityErrorCalled by the RaiseUnsupportedCapabilitiesError method to compare the capabilities requested for an ExecuteSelect operation against those that the view supports.
Public methodSelectGets a list of data asynchronously from the underlying data storage.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodUpdatePerforms an asynchronous update operation on the list of data that the DataSourceView object represents.
Top

  NameDescription
Public eventDataSourceViewChangedOccurs when the data source view has changed.
Top

ASP.NET supports a data-binding architecture that enables Web server controls to bind to data in a consistent fashion. Web server controls that bind to data are referred to as data-bound controls, and the classes that facilitate that binding are called data source controls. Data source controls can represent any data source: a relational database, a file, a stream, a business object, and so on. Data source controls present data in a consistent way to data-bound controls, regardless of the source or format of the underlying data.

You use the data source controls that are provided with ASP.NET, including SqlDataSource, AccessDataSource, and XmlDataSource, to perform most Web development tasks. You use the base DataSourceControl and DataSourceView classes when you want to implement your own custom data source control.

You can think of a data source control as the combination of the IDataSource object and its associated lists of data, called data source views. Each list of data is represented by a DataSourceView object. The DataSourceView class is the base class for all data source views, or lists of data, associated with data source controls. Data source views define the capabilities of a data source control. Because the underlying data storage contains one or more lists of data, a data source control is always associated with one or more named data source views. The data source control uses the GetViewNames method to enumerate the data source views currently associated with the data source control and the GetView method to retrieve a specific data source view instance by name.

All DataSourceView objects support data retrieval from the underlying data source using the ExecuteSelect method. All views optionally support a basic set of operations, including operations such as ExecuteInsert, ExecuteUpdate, and ExecuteDelete. A data-bound control can discover the capabilities of a data source control by retrieving an associated data source view using the GetView and GetViewNames methods, and by querying the view at design time or run time.

The following code example demonstrates how to extend the DataSourceView class to create a strongly typed view class for a data source control. The CsVDataSourceView class defines the capabilities of the CsvDataSource data source control and provides an implementation for data-bound controls to use data stored in comma-separated value (.csv) files. For more information on the CsvDataSource data source control, see the DataSourceControl class.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft