LinqDataSourceView LinqDataSourceView LinqDataSourceView 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
LinqDataSourceViewLinqDataSourceViewLinqDataSourceViewLinqDataSourceView

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) LinqDataSourceView(LinqDataSource, String, HttpContext) LinqDataSourceView(LinqDataSource, String, HttpContext) 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 AutoGenerateOrderByClause AutoGenerateOrderByClause 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 AutoGenerateWhereClause AutoGenerateWhereClause 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 AutoPage AutoPage AutoPage

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

AutoSort AutoSort AutoSort AutoSort

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

CanDelete CanDelete CanDelete CanDelete

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

CanInsert CanInsert CanInsert CanInsert

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

CanPage CanPage CanPage CanPage

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

CanRetrieveTotalRowCount CanRetrieveTotalRowCount CanRetrieveTotalRowCount 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 CanSort CanSort 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 CanUpdate CanUpdate CanUpdate

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

ContextType ContextType ContextType ContextType

Gets the type of the data context class.

ContextTypeName ContextTypeName ContextTypeName ContextTypeName

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

DeleteParameters DeleteParameters DeleteParameters DeleteParameters

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

EnableDelete EnableDelete EnableDelete EnableDelete

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

EnableInsert EnableInsert EnableInsert EnableInsert

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

EnableObjectTracking EnableObjectTracking EnableObjectTracking EnableObjectTracking

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

EnableUpdate EnableUpdate EnableUpdate EnableUpdate

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

Events Events Events Events

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

(Inherited from DataSourceView)
GroupBy GroupBy GroupBy GroupBy

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

GroupByParameters GroupByParameters GroupByParameters GroupByParameters

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

InsertParameters InsertParameters InsertParameters InsertParameters

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

IsTrackingViewState IsTrackingViewState IsTrackingViewState IsTrackingViewState

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

Name Name Name Name

Gets the name of the data source view.

(Inherited from DataSourceView)
OrderBy OrderBy OrderBy OrderBy

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

OrderByParameters OrderByParameters OrderByParameters OrderByParameters

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

OrderGroupsBy OrderGroupsBy OrderGroupsBy OrderGroupsBy

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

OrderGroupsByParameters OrderGroupsByParameters OrderGroupsByParameters OrderGroupsByParameters

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

SelectNew SelectNew SelectNew SelectNew

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

SelectNewParameters SelectNewParameters SelectNewParameters SelectNewParameters

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

StoreOriginalValuesInViewState StoreOriginalValuesInViewState StoreOriginalValuesInViewState 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 TableName TableName TableName

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

UpdateParameters UpdateParameters UpdateParameters UpdateParameters

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

Where Where Where Where

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

WhereParameters WhereParameters WhereParameters WhereParameters

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

Methods

CanExecute(String) CanExecute(String) CanExecute(String) CanExecute(String)

Determines whether the specified command can be executed.

(Inherited from DataSourceView)
CreateContext(DataSourceOperation) CreateContext(DataSourceOperation) CreateContext(DataSourceOperation) CreateContext(DataSourceOperation)

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

CreateContext(Type) CreateContext(Type) CreateContext(Type) CreateContext(Type)

Creates an instance of the data context type.

Delete(IDictionary, IDictionary) Delete(IDictionary, IDictionary) Delete(IDictionary, IDictionary) Delete(IDictionary, IDictionary)

Performs a delete operation.

Delete(IDictionary, IDictionary, DataSourceViewOperationCallback) Delete(IDictionary, IDictionary, DataSourceViewOperationCallback) Delete(IDictionary, IDictionary, DataSourceViewOperationCallback) 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) DeleteDataObject(Object, Object, Object) DeleteDataObject(Object, Object, Object) DeleteDataObject(Object, Object, Object)

Deletes a data object from a table.

DeleteObject(Object) DeleteObject(Object) DeleteObject(Object) DeleteObject(Object)

Deletes a data object from a table.

DisposeContext(Object) DisposeContext(Object) DisposeContext(Object) DisposeContext(Object)

Disposes the data context.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

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

Executes the specified command.

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

Executes the specified command.

(Inherited from DataSourceView)
ExecuteDelete(IDictionary, IDictionary) ExecuteDelete(IDictionary, IDictionary) ExecuteDelete(IDictionary, IDictionary) ExecuteDelete(IDictionary, IDictionary)

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

ExecuteInsert(IDictionary) ExecuteInsert(IDictionary) ExecuteInsert(IDictionary) ExecuteInsert(IDictionary)

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

ExecuteSelect(DataSourceSelectArguments) ExecuteSelect(DataSourceSelectArguments) ExecuteSelect(DataSourceSelectArguments) ExecuteSelect(DataSourceSelectArguments)

Performs a data retrieval operation.

ExecuteUpdate(IDictionary, IDictionary, IDictionary) ExecuteUpdate(IDictionary, IDictionary, IDictionary) ExecuteUpdate(IDictionary, IDictionary, IDictionary) ExecuteUpdate(IDictionary, IDictionary, IDictionary)

Performs an update operation.

GetDataObjectType(Type) GetDataObjectType(Type) GetDataObjectType(Type) GetDataObjectType(Type)

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

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetSource(QueryContext) GetSource(QueryContext) GetSource(QueryContext) GetSource(QueryContext)

Returns the data source to apply a query to.

GetTableMemberInfo(Type) GetTableMemberInfo(Type) GetTableMemberInfo(Type) GetTableMemberInfo(Type)

Retrieves metadata about the data collection.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

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

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

Insert(IDictionary) Insert(IDictionary) Insert(IDictionary) Insert(IDictionary)

Performs an insert operation.

Insert(IDictionary, DataSourceViewOperationCallback) Insert(IDictionary, DataSourceViewOperationCallback) Insert(IDictionary, DataSourceViewOperationCallback) 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) InsertDataObject(Object, Object, Object) InsertDataObject(Object, Object, Object) InsertDataObject(Object, Object, Object)

Inserts a data object into a table.

InsertObject(Object) InsertObject(Object) InsertObject(Object) InsertObject(Object)

Inserts a data object into a LinqDataSourceView object.

LoadViewState(Object) LoadViewState(Object) LoadViewState(Object) LoadViewState(Object)

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

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnContextCreated(LinqDataSourceStatusEventArgs) OnContextCreated(LinqDataSourceStatusEventArgs) OnContextCreated(LinqDataSourceStatusEventArgs) OnContextCreated(LinqDataSourceStatusEventArgs)

Raises the ContextCreated event.

OnContextCreating(LinqDataSourceContextEventArgs) OnContextCreating(LinqDataSourceContextEventArgs) OnContextCreating(LinqDataSourceContextEventArgs) OnContextCreating(LinqDataSourceContextEventArgs)

Raises the ContextCreating event.

OnContextDisposing(LinqDataSourceDisposeEventArgs) OnContextDisposing(LinqDataSourceDisposeEventArgs) OnContextDisposing(LinqDataSourceDisposeEventArgs) OnContextDisposing(LinqDataSourceDisposeEventArgs)

Raises the ContextDisposing event.

OnDataSourceViewChanged(EventArgs) OnDataSourceViewChanged(EventArgs) OnDataSourceViewChanged(EventArgs) OnDataSourceViewChanged(EventArgs)

Raises the DataSourceViewChanged event.

(Inherited from DataSourceView)
OnDeleted(LinqDataSourceStatusEventArgs) OnDeleted(LinqDataSourceStatusEventArgs) OnDeleted(LinqDataSourceStatusEventArgs) OnDeleted(LinqDataSourceStatusEventArgs)

Raises the Deleted event.

OnDeleting(LinqDataSourceDeleteEventArgs) OnDeleting(LinqDataSourceDeleteEventArgs) OnDeleting(LinqDataSourceDeleteEventArgs) OnDeleting(LinqDataSourceDeleteEventArgs)

Raises the Deleting event.

OnException(DynamicValidatorEventArgs) OnException(DynamicValidatorEventArgs) OnException(DynamicValidatorEventArgs) OnException(DynamicValidatorEventArgs)

Raises the Exception event when a data operation fails.

OnInserted(LinqDataSourceStatusEventArgs) OnInserted(LinqDataSourceStatusEventArgs) OnInserted(LinqDataSourceStatusEventArgs) OnInserted(LinqDataSourceStatusEventArgs)

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

OnInserting(LinqDataSourceInsertEventArgs) OnInserting(LinqDataSourceInsertEventArgs) OnInserting(LinqDataSourceInsertEventArgs) OnInserting(LinqDataSourceInsertEventArgs)

Raises the Inserting event.

OnSelected(LinqDataSourceStatusEventArgs) OnSelected(LinqDataSourceStatusEventArgs) OnSelected(LinqDataSourceStatusEventArgs) OnSelected(LinqDataSourceStatusEventArgs)

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

OnSelecting(LinqDataSourceSelectEventArgs) OnSelecting(LinqDataSourceSelectEventArgs) OnSelecting(LinqDataSourceSelectEventArgs) OnSelecting(LinqDataSourceSelectEventArgs)

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

OnUpdated(LinqDataSourceStatusEventArgs) OnUpdated(LinqDataSourceStatusEventArgs) OnUpdated(LinqDataSourceStatusEventArgs) OnUpdated(LinqDataSourceStatusEventArgs)

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

OnUpdating(LinqDataSourceUpdateEventArgs) OnUpdating(LinqDataSourceUpdateEventArgs) OnUpdating(LinqDataSourceUpdateEventArgs) OnUpdating(LinqDataSourceUpdateEventArgs)

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

RaiseUnsupportedCapabilityError(DataSourceCapabilities) RaiseUnsupportedCapabilityError(DataSourceCapabilities) RaiseUnsupportedCapabilityError(DataSourceCapabilities) 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) ResetDataObject(Object, Object) ResetDataObject(Object, Object) ResetDataObject(Object, Object)

Resets the object that contains data to its original state.

SaveViewState() SaveViewState() SaveViewState() 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) Select(DataSourceSelectArguments) Select(DataSourceSelectArguments) Select(DataSourceSelectArguments)

Retrieves data from the data source.

Select(DataSourceSelectArguments, DataSourceViewSelectCallback) Select(DataSourceSelectArguments, DataSourceViewSelectCallback) Select(DataSourceSelectArguments, DataSourceViewSelectCallback) Select(DataSourceSelectArguments, DataSourceViewSelectCallback)

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

(Inherited from DataSourceView)
StoreOriginalValues(IList) StoreOriginalValues(IList) StoreOriginalValues(IList) StoreOriginalValues(IList)

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

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
TrackViewState() TrackViewState() TrackViewState() TrackViewState()

Tracks view state changes.

Update(IDictionary, IDictionary, IDictionary) Update(IDictionary, IDictionary, IDictionary) Update(IDictionary, IDictionary, IDictionary) Update(IDictionary, IDictionary, IDictionary)

Performs an update operation.

Update(IDictionary, IDictionary, IDictionary, DataSourceViewOperationCallback) Update(IDictionary, IDictionary, IDictionary, DataSourceViewOperationCallback) Update(IDictionary, IDictionary, IDictionary, DataSourceViewOperationCallback) 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) UpdateDataObject(Object, Object, Object, Object) UpdateDataObject(Object, Object, Object, Object) UpdateDataObject(Object, Object, Object, Object)

Updates a data object.

UpdateObject(Object, Object) UpdateObject(Object, Object) UpdateObject(Object, Object) UpdateObject(Object, Object)

Updates a data object.

ValidateContextType(Type, Boolean) ValidateContextType(Type, Boolean) ValidateContextType(Type, Boolean) ValidateContextType(Type, Boolean)

Checks whether the data context class derives from DataContext.

ValidateDeleteSupported(IDictionary, IDictionary) ValidateDeleteSupported(IDictionary, IDictionary) ValidateDeleteSupported(IDictionary, IDictionary) ValidateDeleteSupported(IDictionary, IDictionary)

Validates that the conditions exist to perform a delete operation.

ValidateEditSupported() ValidateEditSupported() ValidateEditSupported() ValidateEditSupported()

Validates that the conditions exist to perform an edit operation.

ValidateInsertSupported(IDictionary) ValidateInsertSupported(IDictionary) ValidateInsertSupported(IDictionary) ValidateInsertSupported(IDictionary)

Validates that the conditions exist to perform an insert operation.

ValidateOrderByParameter(String, String) ValidateOrderByParameter(String, String) ValidateOrderByParameter(String, String) ValidateOrderByParameter(String, String)

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

ValidateParameterName(String) ValidateParameterName(String) ValidateParameterName(String) ValidateParameterName(String)

Verifies that the provided parameter name is valid.

ValidateTableType(Type, Boolean) ValidateTableType(Type, Boolean) ValidateTableType(Type, Boolean) ValidateTableType(Type, Boolean)

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

ValidateUpdateSupported(IDictionary, IDictionary, IDictionary) ValidateUpdateSupported(IDictionary, IDictionary, IDictionary) ValidateUpdateSupported(IDictionary, IDictionary, IDictionary) ValidateUpdateSupported(IDictionary, IDictionary, IDictionary)

Validates that the conditions exist to perform an update operation.

Events

ContextCreated ContextCreated ContextCreated ContextCreated

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

ContextCreating ContextCreating ContextCreating ContextCreating

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

ContextDisposing ContextDisposing ContextDisposing ContextDisposing

Occurs before disposing the context type object.

DataSourceViewChanged DataSourceViewChanged DataSourceViewChanged DataSourceViewChanged

Occurs when the data source view has changed.

(Inherited from DataSourceView)
Deleted Deleted Deleted Deleted

Occurs when a delete operation has finished.

Deleting Deleting Deleting Deleting

Occurs before a delete operation.

Inserted Inserted Inserted Inserted

Occurs when an insert operation has finished.

Inserting Inserting Inserting Inserting

Occurs before an insert operation.

Selected Selected Selected Selected

Occurs when a data-retrieval operation has completed.

Selecting Selecting Selecting Selecting

Occurs before a data-retrieval operation.

Updated Updated Updated Updated

Occurs when an update operation has finished.

Updating Updating Updating Updating

Occurs before an update operation.

Explicit Interface Implementations

IStateManager.IsTrackingViewState IStateManager.IsTrackingViewState IStateManager.IsTrackingViewState IStateManager.IsTrackingViewState

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

IStateManager.LoadViewState(Object) IStateManager.LoadViewState(Object) IStateManager.LoadViewState(Object) IStateManager.LoadViewState(Object)

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

IStateManager.SaveViewState() IStateManager.SaveViewState() IStateManager.SaveViewState() IStateManager.SaveViewState()

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

IStateManager.TrackViewState() IStateManager.TrackViewState() IStateManager.TrackViewState() IStateManager.TrackViewState()

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

Applies to