LinqDataSourceView 類別

定義

支援 LinqDataSource 控制項,並提供資料繫結控制項的介面,以執行 LINQ 資料作業。

public ref class LinqDataSourceView : System::Web::UI::DataSourceView, System::Web::UI::IStateManager
public ref class LinqDataSourceView : System::Web::UI::WebControls::ContextDataSourceView
public class LinqDataSourceView : System.Web.UI.DataSourceView, System.Web.UI.IStateManager
public class LinqDataSourceView : System.Web.UI.WebControls.ContextDataSourceView
type LinqDataSourceView = class
    inherit DataSourceView
    interface IStateManager
type LinqDataSourceView = class
    inherit ContextDataSourceView
Public Class LinqDataSourceView
Inherits DataSourceView
Implements IStateManager
Public Class LinqDataSourceView
Inherits ContextDataSourceView
繼承
LinqDataSourceView
繼承
實作

備註

類別 LinqDataSourceView 主要是供資料系結控制項使用,而不是作為頁面程式碼中的可程式化物件。 頁面開發人員通常會使用 LinqDataSource 控制項來與資料互動。

ASP.NET 資料來源控制項包含一或多個資料清單,由資料來源檢視物件表示。 類別 LinqDataSourceViewDataSourceView 擴充 類別。 它會定義與其相關聯之控制項的功能 LinqDataSource ,並實作資料來源控制項的基本資料功能。 類別 LinqDataSourceView 會實作 SelectUpdateInsertDelete 作業。 它也會實作處於檢視狀態的排序、篩選和管理設定。

LinqDataSourceView雖然物件並未直接公開給頁面開發人員,但可以透過 LinqDataSource 控制項存取其許多屬性和方法。 控制項 LinqDataSourceView 會實作下列資料擷取方法和事件,並透過相關聯的 LinqDataSource 控制項將其公開給頁面開發人員和其他呼叫端:

您可以藉由新增 OrderBy 子句來 LinqDataSource 排序使用 控制項擷取的資料。 您可以藉由設定 SortExpression 傳遞至 方法之 物件的 屬性,來提供 實例的 DataSourceSelectArgumentsSelect 排序運算式 LinqDataSourceView 。 屬性的 SortExpression 語法與屬性的 DataView.Sort 語法相同。

控制項 LinqDataSourceView 會實作 介面, IStateManager 並使用檢視狀態來追蹤其跨頁面要求的狀態。 提供 屬性和 LoadViewStateSaveViewStateTrackViewState 方法的 IsTrackingViewState 實作,以啟用控制項的檢視狀態追蹤。 如需詳細資訊,請參閱 ASP.NET 狀態管理概觀

建構函式

LinqDataSourceView(LinqDataSource, String, HttpContext)

將指定的 LinqDataSourceView 控制項設定為目前檢視的擁有者,初始化 LinqDataSource 類別的新執行個體。

屬性

AutoGenerateOrderByClause

取得或設定值,指出與目前 LinqDataSource 控制項建立關聯的 LinqDataSourceView 物件是否支援動態建立 OrderBy 子句。

AutoGenerateOrderByClause

取得或設定值,這個值表示與目前 QueryableDataSourceView 控制項相關聯的 QueryableDataSource 物件是否會建立動態 OrderBy 子句。

(繼承來源 QueryableDataSourceView)
AutoGenerateWhereClause

取得或設定值,指出與目前 LinqDataSource 控制項建立關聯的 LinqDataSourceView 物件是否支援動態建立 Where 子句。

AutoGenerateWhereClause

取得或設定值,這個值表示與目前 QueryableDataSourceView 控制項相關聯的 QueryableDataSource 物件是否會建立動態 Where 子句。

(繼承來源 QueryableDataSourceView)
AutoPage

取得或設定,表示與目前 LinqDataSourceView 控制項相關聯的 LinqDataSource 物件是否支援自動分頁。

AutoPage

取得或設定值,這個值表示與目前 QueryableDataSourceView 控制項相關聯的 QueryableDataSource 物件預設是否支援分頁。

(繼承來源 QueryableDataSourceView)
AutoSort

取得或設定值,表示與目前 LinqDataSourceView 控制項相關聯的 LinqDataSource 物件是否支援自動排序。

AutoSort

取得或設定值,這個值表示與目前 QueryableDataSourceView 控制項相關聯的 QueryableDataSource 物件預設是否支援排序。

(繼承來源 QueryableDataSourceView)
CanDelete

取得值,表示與目前 LinqDataSourceView 控制項相關聯的 LinqDataSource 物件是否支援刪除作業。

CanInsert

取得值,表示與目前 LinqDataSourceView 控制項相關聯的 LinqDataSource 物件是否支援插入作業。

CanPage

取得值,表示與目前 LinqDataSource 控制項關聯的 LinqDataSourceView 物件是否支援對擷取的資料進行分頁。

CanRetrieveTotalRowCount

取得值,表示與目前 LinqDataSource 控制項關聯的 LinqDataSourceView 物件除了支援擷取資料之外,是否還支援擷取資料列的總數。

CanSort

取得值,表示與目前 LinqDataSource 控制項相關聯的 LinqDataSourceView 物件是否支援對擷取資料的排序檢視。

CanUpdate

取得值,表示與目前 LinqDataSourceView 控制項相關聯的 LinqDataSource 物件是否支援更新作業。

Context

取得或設定目前的資料內容。

(繼承來源 ContextDataSourceView)
ContextType

取得資料內容類別的型別。

ContextTypeName

取得或設定資料內容類別的名稱,這個資料內容類別包含 TableName 屬性中指定的欄位或屬性。

DeleteParameters

取得參數集合,這個集合包含刪除作業期間所使用的參數。

DeleteParameters

取得集合,這個集合包含刪除作業期間所使用的參數。

(繼承來源 QueryableDataSourceView)
EnableDelete

取得或設定值,表示資料來源檢視是否支援刪除資料列。

EnableInsert

取得或設定值,表示資料來源檢視是否支援加入新的資料列。

EnableObjectTracking

取得或設定值,這個值指出是否追蹤資料內容物件的變更。

EnableUpdate

取得或設定值,表示資料來源檢視是否支援更新資料列。

EntitySet

取得或設定物件,這個物件包含要擷取的資料值。

(繼承來源 ContextDataSourceView)
EntitySetName

取得或設定資料內容類別中,表示資料集合之屬性或欄位的名稱。

(繼承來源 ContextDataSourceView)
EntitySetType

取得或設定針對插入、刪除和更新作業建立之物件的名稱。

(繼承來源 ContextDataSourceView)
EntityType

取得或設定針對插入、刪除和更新作業建立的物件。

(繼承來源 ContextDataSourceView)
EntityTypeName

取得或設定針對插入、刪除和更新作業建立之物件的名稱。

(繼承來源 ContextDataSourceView)
Events

取得資料來源檢視的事件處理常式委派清單。

(繼承來源 DataSourceView)
GroupBy

取得或設定屬性的名稱,在選取作業期間使用這些屬性將資料分組。

GroupBy

取得或設定屬性的名稱,在選取作業期間使用這些屬性將資料分組。

(繼承來源 QueryableDataSourceView)
GroupByParameters

取得參數的集合,這些參數的值會用來在選取作業期間建立 GroupBy 子句。

GroupByParameters

取得參數的集合,在選取作業期間使用這些參數的值建立 GroupBy 子句。

(繼承來源 QueryableDataSourceView)
InsertParameters

取得插入作業期間所使用的參數集合。

InsertParameters

取得插入作業期間所使用的參數集合。

(繼承來源 QueryableDataSourceView)
IsTrackingViewState

取得值,指出 LinqDataSourceView 物件是否正在儲存變更至它的檢視狀態。

IsTrackingViewState

取得值,指出 QueryableDataSourceView 物件是否正在儲存變更至它的檢視狀態。

(繼承來源 QueryableDataSourceView)
Name

取得資料來源檢視的名稱。

(繼承來源 DataSourceView)
OrderBy

取得或設定屬性的名稱,在選取作業期間使用這些屬性排序資料。

OrderBy

取得或設定屬性的名稱,選取作業期間會使用這些屬性排序資料。

(繼承來源 QueryableDataSourceView)
OrderByParameters

取得用於建立 OrderBy 子句的參數集合。

OrderByParameters

取得參數集合,選取作業期間會使用這些參數排序資料。

(繼承來源 QueryableDataSourceView)
OrderGroupsBy

取得或設定屬性的名稱,在選取作業期間使用這些屬性排序群組資料。

OrderGroupsBy

取得或設定屬性的名稱,選取作業期間會使用這些屬性排序分組的資料。

(繼承來源 QueryableDataSourceView)
OrderGroupsByParameters

取得用於建立 OrderGroupsBy 子句的參數集合。

OrderGroupsByParameters

取得用於建立 OrderGroupsBy 子句的參數集合。

(繼承來源 QueryableDataSourceView)
SelectNew

取得或設定屬性以及擷取之資料中包含的計算值。

SelectNew

取得或設定屬性以及擷取之資料中包含的計算值。

(繼承來源 QueryableDataSourceView)
SelectNewParameters

取得擷取資料作業期間所使用的參數集合。

SelectNewParameters

取得擷取資料作業期間所使用的參數集合。

(繼承來源 QueryableDataSourceView)
StoreOriginalValuesInViewState

取得或設定值,表示當刪除或更新作業啟用時,選取作業的原始值會儲存在檢視狀態中。

TableName

取得或設定資料內容類別的屬性或欄位名稱,這個類別包含資料集合。

UpdateParameters

取得更新作業期間所使用的參數集合。

UpdateParameters

取得更新作業期間所使用的參數集合。

(繼承來源 QueryableDataSourceView)
Where

取得或設定值,這個值指定針對要併入擷取之資料的資料錄,必須為 true 的條件。

Where

取得或設定值,這個值指定資料列在併入至擷取的資料中之前,必須為 true 的條件。

(繼承來源 QueryableDataSourceView)
WhereParameters

取得用於建立 Where 子句的參數集合。

WhereParameters

取得用於建立 Where 子句的參數集合。

(繼承來源 QueryableDataSourceView)

方法

BuildDeleteObject(IDictionary, IDictionary, IDictionary<String,Exception>)

建立要用於刪除作業的物件。

(繼承來源 QueryableDataSourceView)
BuildInsertObject(IDictionary, IDictionary<String,Exception>)

使用要插入的值和作業失敗時要顯示的錯誤訊息,建立要用於插入作業的物件。

(繼承來源 QueryableDataSourceView)
BuildQuery(DataSourceSelectArguments)

使用資料來源的 Select 引數建立 Select 查詢運算式。

(繼承來源 QueryableDataSourceView)
BuildUpdateObjects(IDictionary, IDictionary, IDictionary, IDictionary<String,Exception>)

使用指定的值建立要用於更新作業的物件。

(繼承來源 QueryableDataSourceView)
CanExecute(String)

判斷是否可以執行指定的命令。

(繼承來源 DataSourceView)
ClearOriginalValues()

清除原始值。

(繼承來源 QueryableDataSourceView)
CreateContext(DataSourceOperation)

使用指定的資料來源作業建立資料內容型別的執行個體。

CreateContext(Type)

建立資料內容型別的執行個體。

CreateQueryContext(DataSourceSelectArguments)

建立查詢內容物件的執行個體,這個執行個體包含評估的參數集合。

(繼承來源 QueryableDataSourceView)
Delete(IDictionary, IDictionary)

執行刪除作業。

Delete(IDictionary, IDictionary)

執行刪除作業。

(繼承來源 QueryableDataSourceView)
Delete(IDictionary, IDictionary, DataSourceViewOperationCallback)

DataSourceView 物件表示的資料清單上,執行非同步刪除作業。

(繼承來源 DataSourceView)
DeleteDataObject(Object, Object, Object)

從資料表刪除資料物件。

DeleteObject(Object)

從資料表刪除資料物件。

DisposeContext()

在執行作業之後處置內容。

(繼承來源 ContextDataSourceView)
DisposeContext(Object)

處置資料內容。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
ExecuteCommand(String, IDictionary, IDictionary)

執行指定命令。

(繼承來源 DataSourceView)
ExecuteCommand(String, IDictionary, IDictionary, DataSourceViewOperationCallback)

執行指定命令。

(繼承來源 DataSourceView)
ExecuteDelete(IDictionary, IDictionary)

使用指定的索引鍵和舊值,執行刪除作業。

ExecuteInsert(IDictionary)

使用集合中指定的值,執行插入作業。

ExecutePaging(IQueryable, QueryContext)

使用 QueryContext 物件中的 QueryableDataSource 物件執行分頁。

(繼承來源 QueryableDataSourceView)
ExecuteQuery(IQueryable, QueryContext)

IQueryable<T> 物件執行查詢、排序或分頁作業。

(繼承來源 QueryableDataSourceView)
ExecuteQueryExpressions(IQueryable, QueryContext)

使用 IQueryable 物件和 QueryContext 物件執行查詢運算式。

(繼承來源 QueryableDataSourceView)
ExecuteSelect(DataSourceSelectArguments)

執行資料擷取作業。

ExecuteSorting(IQueryable, QueryContext)

執行排序作業。

(繼承來源 QueryableDataSourceView)
ExecuteUpdate(IDictionary, IDictionary, IDictionary)

執行更新作業。

GetDataObjectType(Type)

取得要用於刪除、插入和更新作業的資料物件型別。

GetDataObjectType(Type)

擷取要用於刪除、插入和更新作業之資料物件的型別。

(繼承來源 ContextDataSourceView)
GetEntitySetType()

將實體集當做屬性、欄位或資料內容擷取。

(繼承來源 ContextDataSourceView)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetOriginalValues(IDictionary)

擷取在 Select 作業期間針對指定的索引鍵儲存的原始值。

(繼承來源 QueryableDataSourceView)
GetSource(QueryContext)

傳回要套用查詢的資料來源。

GetTableMemberInfo(Type)

擷取資料集合的中繼資料。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
HandleValidationErrors(IDictionary<String,Exception>, DataSourceOperation)

處理當建立資料物件時發生資料作業失敗的任何例外狀況。

Insert(IDictionary)

執行插入作業。

Insert(IDictionary)

QueryableDataSourceView 物件表示的資料項目上,執行非同步插入作業。

(繼承來源 QueryableDataSourceView)
Insert(IDictionary, DataSourceViewOperationCallback)

DataSourceView 物件表示的資料清單上,執行非同步插入作業。

(繼承來源 DataSourceView)
InsertDataObject(Object, Object, Object)

將資料物件插入資料表。

InsertObject(Object)

將資料物件插入 LinqDataSourceView 物件中。

LoadViewState(Object)

還原資料來源檢視之先前儲存的檢視狀態。

LoadViewState(Object)

還原資料來源檢視之先前儲存的檢視狀態。

(繼承來源 QueryableDataSourceView)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
OnContextCreated(LinqDataSourceStatusEventArgs)

引發 ContextCreated 事件。

OnContextCreating(LinqDataSourceContextEventArgs)

引發 ContextCreating 事件。

OnContextDisposing(LinqDataSourceDisposeEventArgs)

引發 ContextDisposing 事件。

OnDataSourceViewChanged(EventArgs)

引發 DataSourceViewChanged 事件。

(繼承來源 DataSourceView)
OnDeleted(LinqDataSourceStatusEventArgs)

引發 Deleted 事件。

OnDeleting(LinqDataSourceDeleteEventArgs)

引發 Deleting 事件。

OnException(DynamicValidatorEventArgs)

資料作業失敗時引發 Exception 事件。

OnInserted(LinqDataSourceStatusEventArgs)

Inserted 控制項完成插入作業之後,引發 LinqDataSource 事件。

OnInserting(LinqDataSourceInsertEventArgs)

引發 Inserting 事件。

OnQueryCreated(QueryCreatedEventArgs)

QueryCreated 控制項建立 QueryableDataSource 物件之後引發 IQueryable 事件。

(繼承來源 QueryableDataSourceView)
OnQueryParametersChanged(Object, EventArgs)

呼叫 RaiseViewChanged() 方法。

(繼承來源 QueryableDataSourceView)
OnSelected(LinqDataSourceStatusEventArgs)

Selected 控制項完成資料擷取作業之後,引發 LinqDataSource 事件。

OnSelecting(LinqDataSourceSelectEventArgs)

Selecting 控制項執行資料擷取作業之前,引發 LinqDataSource 事件。

OnUpdated(LinqDataSourceStatusEventArgs)

Updated 控制項完成更新作業之後,引發 LinqDataSource 事件。

OnUpdating(LinqDataSourceUpdateEventArgs)

Updating 控制項執行更新作業之前,引發 LinqDataSource 事件。

RaiseUnsupportedCapabilityError(DataSourceCapabilities)

RaiseUnsupportedCapabilitiesError(DataSourceView) 方法呼叫,以比較針對 ExecuteSelect(DataSourceSelectArguments) 作業要求的功能與檢視支援的功能。

(繼承來源 DataSourceView)
RaiseViewChanged()

呼叫 OnDataSourceViewChanged(EventArgs) 方法。

(繼承來源 QueryableDataSourceView)
ResetDataObject(Object, Object)

將包含資料的物件重設為其原始狀態。

SaveViewState()

儲存自頁面回傳至伺服器以來,LinqDataSourceView 控制項之檢視狀態的變更。

SaveViewState()

儲存自頁面張貼至伺服器以來,QueryableDataSourceView 物件檢視狀態的變更。

(繼承來源 QueryableDataSourceView)
Select(DataSourceSelectArguments)

擷取資料來源中的資料。

Select(DataSourceSelectArguments, DataSourceViewSelectCallback)

從基礎資料儲存區非同步取得資料清單。

(繼承來源 DataSourceView)
StoreOriginalValues(IList)

在控制項的檢視狀態下,儲存來自 Select 作業的原始值。

StoreOriginalValues(IList, Func<PropertyDescriptor,Boolean>)

當啟用刪除或更新作業時,將選取作業中的原始值儲存在控制項的檢視狀態中。

(繼承來源 QueryableDataSourceView)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)
TrackViewState()

追蹤檢視狀態變更。

TrackViewState()

導致追蹤伺服器控制項檢視狀態的變更,以便將這些變更儲存於伺服器控制項的狀態中。

(繼承來源 QueryableDataSourceView)
Update(IDictionary, IDictionary, IDictionary)

執行更新作業。

Update(IDictionary, IDictionary, IDictionary)

執行更新作業。

(繼承來源 QueryableDataSourceView)
Update(IDictionary, IDictionary, IDictionary, DataSourceViewOperationCallback)

DataSourceView 物件表示的資料清單上,執行非同步更新作業。

(繼承來源 DataSourceView)
UpdateDataObject(Object, Object, Object, Object)

更新資料物件。

UpdateObject(Object, Object)

更新資料物件。

ValidateContextType(Type, Boolean)

檢查資料內容類別是否衍生自 DataContext

ValidateDeleteSupported(IDictionary, IDictionary)

驗證狀況適合執行刪除作業。

ValidateEditSupported()

驗證狀況適合執行編輯作業。

ValidateInsertSupported(IDictionary)

驗證狀況適合執行插入作業。

ValidateOrderByParameter(String, String)

驗證 OrderBy 參數值是否為自動產生的 OrderBy 子句的有效功能變數名稱。

ValidateParameterName(String)

驗證所提供的參數名稱是否有效。

ValidateTableType(Type, Boolean)

檢查表示資料表的類別型別是否為泛型型別。

ValidateUpdateSupported(IDictionary, IDictionary, IDictionary)

驗證狀況適合執行更新作業。

事件

ContextCreated

在建立內容型別物件的執行個體之後發生。

ContextCreating

在建立內容型別物件的執行個體之前發生。

ContextDisposing

在處置內容型別物件之前發生。

DataSourceViewChanged

當資料來源檢視已變更時發生。

(繼承來源 DataSourceView)
Deleted

在刪除作業完成時發生。

Deleting

在刪除作業之前發生。

Inserted

在插入作業完成時發生。

Inserting

在插入作業之前發生。

QueryCreated

發生於查詢建立時。

(繼承來源 QueryableDataSourceView)
Selected

當資料擷取作業完成時發生。

Selecting

在資料擷取作業之前發生。

Updated

在更新作業完成時發生。

Updating

在更新作業之前發生。

明確介面實作

IStateManager.IsTrackingViewState

如需這個成員的描述,請參閱 IsTrackingViewState 屬性。

IStateManager.IsTrackingViewState

由類別實作時會取得值,這個值表示伺服器控制項是否正追蹤其檢視狀態變更。

(繼承來源 QueryableDataSourceView)
IStateManager.LoadViewState(Object)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

如需這個成員的說明,請參閱 LoadViewState(Object)

IStateManager.LoadViewState(Object)

由類別實作時,載入伺服器控制項先前儲存的控制項檢視狀態。

(繼承來源 QueryableDataSourceView)
IStateManager.SaveViewState()

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

如需這個成員的描述,請參閱 SaveViewState() 方法。

IStateManager.SaveViewState()

由類別實作時,將伺服器控制項檢視狀態的變更儲存至物件。

(繼承來源 QueryableDataSourceView)
IStateManager.TrackViewState()

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

如需此成員的描述,請參閱 IStateManagerTrackViewState 方法。

IStateManager.TrackViewState()

由類別實作時會取得值,這個值表示伺服器控制項是否正追蹤其檢視狀態變更。

(繼承來源 QueryableDataSourceView)

適用於