LinqDataSourceView Class

Definition

Supports the LinqDataSource control and provides an interface for data-bound controls to perform LINQ data operations.

public ref class LinqDataSourceView : System::Web::UI::WebControls::ContextDataSourceView
public class LinqDataSourceView : System.Web.UI.WebControls.ContextDataSourceView
type LinqDataSourceView = class
    inherit ContextDataSourceView
Public Class LinqDataSourceView
Inherits ContextDataSourceView
Inheritance
LinqDataSourceView

Remarks

The LinqDataSourceView class is intended primarily to be used by data-bound controls, and not as a programmable object in page code. Page developers typically use the LinqDataSource control to interact with data.

ASP.NET data source controls contain one or more lists of data, represented by data source view objects. The LinqDataSourceView class extends the DataSourceView class. It defines the capabilities of the LinqDataSource control with which it is associated, and it implements the basic data functionality for the data source control. The LinqDataSourceView class implements the Select, Update, Insert, and Delete operations. It also implements sorting, filtering, and managing settings that are kept in view state.

Although the LinqDataSourceView object is not directly exposed to page developers, many of its properties and methods can be accessed through the LinqDataSource control. The LinqDataSourceView control implements the following data retrieval methods and events and exposes them to page developers and to other callers through the associated LinqDataSource control:

You can sort the data that you retrieve with the LinqDataSource control by adding an OrderBy clause. You can provide a sort expression for the LinqDataSourceView instance by setting the SortExpression property of the DataSourceSelectArguments object that is passed to the Select method. The syntax for the SortExpression property is the same as the syntax for a DataView.Sort property.

The LinqDataSourceView control implements the IStateManager interface and uses view state to track its state across page requests. Implementations of the IsTrackingViewState property and the LoadViewState, SaveViewState, and TrackViewState methods are provided to enable view-state tracking for the control. For more information, see ASP.NET State Management Overview.

Constructors

LinqDataSourceView(LinqDataSource, String, HttpContext)

Initializes a new instance of the LinqDataSourceView class, setting the specified LinqDataSource control as the owner of the current view.

Properties

AutoGenerateOrderByClause

Gets or sets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports dynamic creation of an OrderBy clause.

AutoGenerateWhereClause

Gets or sets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports dynamic creation of a Where clause.

AutoPage

Gets or sets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports automatic paging.

AutoSort

Gets or sets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports automatic sorting.

CanDelete

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports the delete operation.

CanInsert

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports the insert operation.

CanPage

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports paging of retrieved data.

CanRetrieveTotalRowCount

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports retrieving the total number of data rows, in addition to retrieving the data.

CanSort

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports a sorted view of the retrieved data.

CanUpdate

Gets a value that indicates whether the LinqDataSourceView object that is associated with the current LinqDataSource control supports the update operation.

ContextType

Gets the type of the data context class.

ContextTypeName

Gets or sets the name of the data context class that contains the field or property specified in the TableName property.

DeleteParameters

Gets the parameters collection that contains the parameters that are used during a delete operation.

EnableDelete

Gets or sets a value that indicates whether the data source view supports deleting rows.

EnableInsert

Gets or sets a value that indicates whether the data source view supports adding new rows.

EnableObjectTracking

Gets or sets a value that indicates whether changes to the data-context object are tracked.

EnableUpdate

Gets or sets a value that indicates whether the data source view supports updating rows.

Events

Gets a list of event-handler delegates for the data source view.

(Inherited from DataSourceView)
GroupBy

Gets or sets the name or names of the properties to use during the select operation for grouping data.

GroupByParameters

Gets a collection of parameters whose values are used to create the GroupBy clause during the select operation.

InsertParameters

Gets a collection of parameters that are used during the insert operation.

IsTrackingViewState

Gets a value that indicates whether the LinqDataSourceView object is saving changes to its view state.

Name

Gets the name of the data source view.

(Inherited from DataSourceView)
OrderBy

Gets or sets the name or names of the properties to use during the select operation for sorting data.

OrderByParameters

Gets a collection of parameters that are used to create the OrderBy clause.

OrderGroupsBy

Gets or sets the names of the properties to use during the select operation for sorting grouped data.

OrderGroupsByParameters

Gets a collection of parameters that are used to create the OrderGroupsBy clause.

SelectNew

Gets or sets the properties and calculated values that are included in the retrieved data.

SelectNewParameters

Gets the collection of parameters that are used during a data-retrieval operation.

StoreOriginalValuesInViewState

Gets or sets a value that indicates that original values from the select operation will be stored in view state when delete or update operations are enabled.

TableName

Gets or sets the name of a property or field of the data context class that contains the data collection.

UpdateParameters

Gets the collection of parameters that are used during an update operation.

Where

Gets or sets a value that specifies what conditions must be true for a record to be included in the retrieved data.

WhereParameters

Gets a collection of parameters that are used to create the Where clause.

Methods

CanExecute(String)

Determines whether the specified command can be executed.

(Inherited from DataSourceView)
CreateContext(DataSourceOperation)

Creates an instance of the data context type using the specified data source operation.

CreateContext(Type)

Creates an instance of the data context type.

Delete(IDictionary, IDictionary)

Performs a delete operation.

Delete(IDictionary, IDictionary, DataSourceViewOperationCallback)

Performs an asynchronous delete operation on the list of data that the DataSourceView object represents.

(Inherited from DataSourceView)
DeleteDataObject(Object, Object, Object)

Deletes a data object from a table.

DeleteObject(Object)

Deletes a data object from a table.

DisposeContext(Object)

Disposes the data context.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
ExecuteCommand(String, IDictionary, IDictionary)

Executes the specified command.

(Inherited from DataSourceView)
ExecuteCommand(String, IDictionary, IDictionary, DataSourceViewOperationCallback)

Executes the specified command.

(Inherited from DataSourceView)
ExecuteDelete(IDictionary, IDictionary)

Performs a delete operation by using the specified keys and old values.

ExecuteInsert(IDictionary)

Performs an insert operation by using the values specified in a collection.

ExecuteSelect(DataSourceSelectArguments)

Performs a data retrieval operation.

ExecuteUpdate(IDictionary, IDictionary, IDictionary)

Performs an update operation.

GetDataObjectType(Type)

Gets the data object type to use for delete, insert, and update operations.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetSource(QueryContext)

Returns the data source to apply a query to.

GetTableMemberInfo(Type)

Retrieves metadata about the data collection.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
HandleValidationErrors(IDictionary<String,Exception>, DataSourceOperation)

Handles any exceptions that occur when a data operation fails while a data object is being created.

Insert(IDictionary)

Performs an insert operation.

Insert(IDictionary, DataSourceViewOperationCallback)

Performs an asynchronous insert operation on the list of data that the DataSourceView object represents.

(Inherited from DataSourceView)
InsertDataObject(Object, Object, Object)

Inserts a data object into a table.

InsertObject(Object)

Inserts a data object into a LinqDataSourceView object.

LoadViewState(Object)

Restores the previously saved view state for the data source view.

MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnContextCreated(LinqDataSourceStatusEventArgs)

Raises the ContextCreated event.

OnContextCreating(LinqDataSourceContextEventArgs)

Raises the ContextCreating event.

OnContextDisposing(LinqDataSourceDisposeEventArgs)

Raises the ContextDisposing event.

OnDataSourceViewChanged(EventArgs)

Raises the DataSourceViewChanged event.

(Inherited from DataSourceView)
OnDeleted(LinqDataSourceStatusEventArgs)

Raises the Deleted event.

OnDeleting(LinqDataSourceDeleteEventArgs)

Raises the Deleting event.

OnException(DynamicValidatorEventArgs)

Raises the Exception event when a data operation fails.

OnInserted(LinqDataSourceStatusEventArgs)

Raises the Inserted event after the LinqDataSource control has completed an insert operation.

OnInserting(LinqDataSourceInsertEventArgs)

Raises the Inserting event.

OnSelected(LinqDataSourceStatusEventArgs)

Raises the Selected event after the LinqDataSource control has completed a data retrieval operation.

OnSelecting(LinqDataSourceSelectEventArgs)

Raises the Selecting event before the LinqDataSource control performs a data-retrieval operation.

OnUpdated(LinqDataSourceStatusEventArgs)

Raises the Updated event after the LinqDataSource control has completed an update operation.

OnUpdating(LinqDataSourceUpdateEventArgs)

Raises the Updating event before the LinqDataSource control performs an update operation.

RaiseUnsupportedCapabilityError(DataSourceCapabilities)

Called by the RaiseUnsupportedCapabilitiesError(DataSourceView) method to compare the capabilities requested for an ExecuteSelect(DataSourceSelectArguments) operation against those that the view supports.

(Inherited from DataSourceView)
ResetDataObject(Object, Object)

Resets the object that contains data to its original state.

SaveViewState()

Saves the changes to view state for the LinqDataSourceView control since the time that the page was posted back to the server.

Select(DataSourceSelectArguments)

Retrieves data from the data source.

Select(DataSourceSelectArguments, DataSourceViewSelectCallback)

Gets a list of data asynchronously from the underlying data storage.

(Inherited from DataSourceView)
StoreOriginalValues(IList)

Stores the original values from the Select operation in the control's view state.

ToString()

Returns a string that represents the current object.

(Inherited from Object)
TrackViewState()

Tracks view state changes.

Update(IDictionary, IDictionary, IDictionary)

Performs an update operation.

Update(IDictionary, IDictionary, IDictionary, DataSourceViewOperationCallback)

Performs an asynchronous update operation on the list of data that the DataSourceView object represents.

(Inherited from DataSourceView)
UpdateDataObject(Object, Object, Object, Object)

Updates a data object.

UpdateObject(Object, Object)

Updates a data object.

ValidateContextType(Type, Boolean)

Checks whether the data context class derives from DataContext.

ValidateDeleteSupported(IDictionary, IDictionary)

Validates that the conditions exist to perform a delete operation.

ValidateEditSupported()

Validates that the conditions exist to perform an edit operation.

ValidateInsertSupported(IDictionary)

Validates that the conditions exist to perform an insert operation.

ValidateOrderByParameter(String, String)

Validates that the OrderBy parameter value is a valid field name for the automatically generated OrderBy clause.

ValidateParameterName(String)

Verifies that the provided parameter name is valid.

ValidateTableType(Type, Boolean)

Checks whether the type of the class that represents the data table is a generic type.

ValidateUpdateSupported(IDictionary, IDictionary, IDictionary)

Validates that the conditions exist to perform an update operation.

Events

ContextCreated

Occurs after an instance of the context type object has been created.

ContextCreating

Occurs before an instance of the context type object is created.

ContextDisposing

Occurs before disposing the context type object.

DataSourceViewChanged

Occurs when the data source view has changed.

(Inherited from DataSourceView)
Deleted

Occurs when a delete operation has finished.

Deleting

Occurs before a delete operation.

Inserted

Occurs when an insert operation has finished.

Inserting

Occurs before an insert operation.

Selected

Occurs when a data-retrieval operation has completed.

Selecting

Occurs before a data-retrieval operation.

Updated

Occurs when an update operation has finished.

Updating

Occurs before an update operation.

Explicit Interface Implementations

IStateManager.IsTrackingViewState

For a description of this member, see the IsTrackingViewState property.

IStateManager.LoadViewState(Object)

For a description of this member, see LoadViewState(Object).

IStateManager.SaveViewState()

For a description of this member, see the SaveViewState() method.

IStateManager.TrackViewState()

For a description of this member, see the IStateManagerTrackViewState method.

Applies to