LinqDataSource 类

定义

支持通过标记文本在 ASP.NET 网页中使用语言集成查询 (LINQ),以从数据对象中检索和修改数据。Enables the use of Language-Integrated Query (LINQ) in an ASP.NET Web page through markup text to retrieve and modify data from a data object.

public ref class LinqDataSource : System::Web::UI::WebControls::ContextDataSource, System::Web::DynamicData::IDynamicDataSource
[System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.LinqDataSource), "LinqDataSource.bmp")]
[System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.LinqDataSource), "LinqDataSource.ico")]
public class LinqDataSource : System.Web.UI.WebControls.ContextDataSource, System.Web.DynamicData.IDynamicDataSource
type LinqDataSource = class
    inherit ContextDataSource
    interface IDynamicDataSource
    interface IDataSource
Public Class LinqDataSource
Inherits ContextDataSource
Implements IDynamicDataSource
继承
属性
实现

示例

下面的示例演示一个 LinqDataSource 控件,该控件从名为 Products的实体类中检索数据。The following example shows a LinqDataSource control that retrieves data from an entity class named Products. 实体类可能是通过使用 O/R 设计器O/R Designer 或 SqlMetal 实用工具生成的。The entity class could have been generated by using the O/R 设计器O/R Designer or the SqlMetal.exe utility. Where 属性设置为仅返回在 Price 属性中具有大于50的值的记录。The Where property is set to return only records that have a value in the Price property greater than 50. GridView 控件绑定到 LinqDataSource 控件以显示数据。A GridView control is bound to the LinqDataSource control to display the data.

<asp:LinqDataSource 
    ContextTypeName="ExampleDataContext" 
    TableName="Products" 
    Where="Price > 50"
    ID="LinqDataSource1" 
    runat="server">
</asp:LinqDataSource>
<asp:GridView 
    DataSourceID="LinqDataSource1"
    ID="GridView1" 
    runat="server">
</asp:GridView>
<asp:LinqDataSource 
    ContextTypeName="ExampleDataContext" 
    TableName="Products" 
    Where="Price > 50"
    ID="LinqDataSource1" 
    runat="server">
</asp:LinqDataSource>
<asp:GridView 
    DataSourceID="LinqDataSource1"
    ID="GridView1" 
    runat="server">
</asp:GridView>

下面的示例演示一个 LinqDataSource 控件,该控件允许用户在数据源中更新、删除和插入记录。The following example shows a LinqDataSource control that enables users to update, delete, and insert records in the data source. DetailsView 控件绑定到 LinqDataSource 控件,并使用户能够查看和修改数据。A DetailsView control is bound to the LinqDataSource control and enables users to see and modify the data. 请注意,不需要 SQL 命令即可选择、更新、删除或插入记录。Notice that no SQL commands are required in order to select, update, delete, or insert the records.

<asp:LinqDataSource 
    ContextTypeName="ExampleDataContext" 
    TableName="Products" 
    EnableUpdate="true"
    EnableInsert="true"
    EnableDelete="true"
    ID="LinqDataSource1" 
    runat="server">
</asp:LinqDataSource>
<asp:DetailsView 
    DataKeyNames="ProductID"
    AutoGenerateEditButton="true"
    AutoGenerateDeleteButton="true"
    AutoGenerateInsertButton="true"
    AllowPaging="true"
    DataSourceID="LinqDataSource1"
    ID="GridView1" 
    runat="server">
</asp:DetailsView>
<asp:LinqDataSource 
    ContextTypeName="ExampleDataContext" 
    TableName="Products" 
    EnableUpdate="true"
    EnableInsert="true"
    EnableDelete="true"
    ID="LinqDataSource1" 
    runat="server">
</asp:LinqDataSource>
<asp:DetailsView 
    DataKeyNames="ProductID"
    AutoGenerateEditButton="true"
    AutoGenerateDeleteButton="true"
    AutoGenerateInsertButton="true"
    AllowPaging="true"
    DataSourceID="LinqDataSource1"
    ID="GridView1" 
    runat="server">
</asp:DetailsView>

下面的示例演示了 Selecting 事件的事件处理程序,该事件根据网页中的值设置数据对象。The following example shows an event handler for the Selecting event that sets the data object based on a value in the Web page.

public partial class Default3 : System.Web.UI.Page
{
    string[] citiesArray = 
    { 
        "Atlanta", 
        "Charlotte", 
        "Denver", 
        "New York", 
        "San Francisco" 
    };

    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void LinqDataSource_Selecting(object sender, LinqDataSourceSelectEventArgs e)
    {
        var cities = from city in citiesArray
                     where city.CompareTo("B") > 0
                     select city;
        e.Result = cities;
        // Or we could set e.Result = citiesArray to return all rows.
    }
}
Partial Class Default3
    Inherits System.Web.UI.Page

    Dim citiesArray() As String = _
    { _
        "Atlanta", _
        "Charlotte", _
        "Denver", _
        "New York", _
        "San Francisco" _
    }


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       
    End Sub

    
    Protected Sub LinqDataSource_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LinqDataSourceSelectEventArgs) Handles LinqDataSource1.Selecting
        Dim cities = From city In citiesArray _
                     Where city > "B" _
                     Select city
        e.Result = cities
        ' Or we could set e.Result = citiesArray to return all rows.
    End Sub
    
End Class

下面的示例演示一个配置为按两列进行分组的 LinqDataSource 控件。The following example shows a LinqDataSource control that is configured to group by two columns. Key 属性引用具有两个属性的对象 ProductCategoryColorThe Key property references an object that has two properties, ProductCategory and Color. It 所表示的对象已重命名(化名为) ProductsThe object represented by It is renamed (aliased) to Products. 重命名 Products 对象包含分组中各个记录的集合。The renamed Products object contains a collection of the individual records in a grouping. 每个实例都包含 Products 表中的所有列。Each instance will contain all the columns from the Products table.

<asp:LinqDataSource 
  ContextTypeName="ExampleDataContext" 
  TableName="Products" 
  GroupBy="new(ProductCategory, Color)"
  Select="new(Key,
          It As Products,
          Max(ListPrice) As MaxListPrice, 
          Min(ListPrice) As MinListPrice)"
  ID="LinqDataSource1" 
  runat="server">
</asp:LinqDataSource>
<asp:LinqDataSource 
  ContextTypeName="ExampleDataContext" 
  TableName="Products" 
  GroupBy="new(ProductCategory, Color)"
  Select="new(Key,
          It As Products,
          Max(ListPrice) As MaxListPrice, 
          Min(ListPrice) As MinListPrice)"
  ID="LinqDataSource1" 
  runat="server">
</asp:LinqDataSource>

下面的示例演示两个 ListView 控件,这些控件在上一个示例中显示 LinqDataSource 控件中的数据。The following example shows two ListView controls that display the data from the LinqDataSource control in the previous example. 一个 ListView 控件显示分组数据,另一个 ListView 控件显示属于该组的产品的各个名称。One ListView control displays the grouped data, and the other ListView control displays the individual names of products that belong to that group. 嵌套的数据绑定控件的 DataSource 属性设置为 Products,这是 It 对象的别名。The nested data-bound control's DataSource property is set to Products, which is the alias for the It object.

<asp:ListView 
    DataSourceID="LinqDataSource1" 
    ID="ListView1" runat="server">

    <LayoutTemplate>
      <table id="Table1" 
          style="background-color:Teal;color:White" 
          runat="server" 
          class="Layout">
          
        <thead>
          <tr>
            <th><b>Product Category</b></th>
            <th><b>Color</b></th>
            <th><b>Highest Price</b></th>
            <th><b>Lowest Price</b></th>
          </tr>
        </thead>
        <tr runat="server" id="itemPlaceholder">
        </tr>
        
      </table>
    </LayoutTemplate>

    <ItemTemplate>
      <tr>
        <td><%# Eval("key.ProductCategory") %></td>
        <td><%# Eval("key.Color") %></td>
        <td><%# Eval("MaxListPrice") %></td>
        <td><%# Eval("MinListPrice") %></td>
      </tr>
      <tr>
        
        <td colspan="4" style="width:100%;background-color:White;color:Black">
          <asp:ListView 
            DataSource='<%# Eval("Products") %>' 
            runat="server" 
            ID="ListView2">

            <LayoutTemplate>
              <div runat="server" id="itemPlaceholder" />
            </LayoutTemplate>

            <ItemTemplate>
              <%# Eval("ProductName") %><br />
            </ItemTemplate>

          </asp:ListView> 
        </td>
      </tr>
    </ItemTemplate>
  </asp:ListView>
<asp:ListView 
   DataSourceID="LinqDataSource1" 
   ID="ListView1" runat="server">

   <LayoutTemplate>
     <table id="Table1" 
         style="background-color:Teal;color:White" 
         runat="server" 
         class="Layout">
         
       <thead>
         <tr>
           <th><b>Product Category</b></th>
           <th><b>Color</b></th>
           <th><b>Highest Price</b></th>
           <th><b>Lowest Price</b></th>
         </tr>
       </thead>
       <tr runat="server" id="itemPlaceholder">
       </tr>
       
     </table>
   </LayoutTemplate>

   <ItemTemplate>
     <tr>
       <td><%# Eval("key.ProductCategory") %></td>
       <td><%# Eval("key.Color") %></td>
       <td><%# Eval("MaxListPrice") %></td>
       <td><%# Eval("MinListPrice") %></td>
     </tr>
     <tr>
       
       <td colspan="4" style="width:100%;background-color:White;color:Black">
         <asp:ListView 
           DataSource='<%# Eval("Products") %>' 
           runat="server" 
           ID="ListView2">

           <LayoutTemplate>
             <div runat="server" id="itemPlaceholder" />
           </LayoutTemplate>

           <ItemTemplate>
             <%# Eval("ProductName") %><br />
           </ItemTemplate>

         </asp:ListView> 
       </td>
     </tr>
   </ItemTemplate>
 </asp:ListView>

注解

本主题内容:In this topic:

介绍Introduction

语言集成查询(LINQ)是一种查询语法,它可定义一组查询运算符,使遍历、筛选和投影操作能够以声明性方式在任何中表示。基于网络的编程语言。Language-Integrated Query (LINQ) is a query syntax that defines a set of query operators that enable traversal, filter, and projection operations to be expressed in a declarative way in any .NET-based programming language. 数据对象可以是内存中的数据集合或表示来自数据库的数据的对象。The data object can be an in-memory data collection or an object that represents data from a database. 您可以检索或修改数据,而不必为每个操作都编写 SQL 命令。You can retrieve or modify the data without having to write SQL commands for each operation.

使用 LinqDataSource 控件,可以通过在标记文本中设置属性来在 ASP.NET 网页中使用 LINQ。The LinqDataSource control enables you to use LINQ in an ASP.NET Web page by setting properties in markup text. LinqDataSource 控件使用 LINQ to SQL 自动生成数据命令。The LinqDataSource control uses LINQ to SQL to automatically generate the data commands. 有关 LINQ to SQL 的详细信息,请参阅LINQ to SQLFor more information about LINQ to SQL, see LINQ to SQL.

从内存中数据集合中检索数据时,可以将 ContextTypeName 属性设置为包含数据集合的类。When you are retrieving data from an in-memory data collection, you set the ContextTypeName property to the class that contains the data collection. TableName 属性设置为返回数据集合的属性或字段。You set the TableName property to the property or field that returns the data collection. 例如,你可能有一个名为 Person 的类,该类包含一个名为 FavoriteCities 的属性,该属性将返回字符串值的数组。For example, you might have a class named Person that contains a property named FavoriteCities that returns an array of string values. 在这种情况下,请将 ContextTypeName 属性设置为 Person 并将 TableName 属性设置为 FavoriteCitiesIn that case, you set the ContextTypeName property to Person and set the TableName property to FavoriteCities.

查询数据库时,必须首先创建表示该数据库及其表的实体类。When you are querying a database, you must first create entity classes that represent the database and its tables. 您可以使用 Object Relational DesignerObject Relational Designer 或 SqlMetal 实用程序来生成这些类。You can use the Object Relational DesignerObject Relational Designer or the SqlMetal.exe utility to generate these classes. 然后,将 ContextTypeName 属性设置为表示数据库的类,并将 TableName 属性设置为表示数据库表的属性。You then set the ContextTypeName property to the class that represents the database and set the TableName property to the property that represents the database table.

操作顺序Order of Operations

LinqDataSource 控件按以下顺序应用数据操作:The LinqDataSource control applies data operations in the following order:

  1. Where (指定要返回的数据记录)。Where (specify which data records to return).

  2. 排序依据(排序)。Order By (sort).

  3. 分组依据(对共享值的数据记录进行聚合)。Group By (aggregate data records that share values).

  4. 排序依据(排序分组数据)。Order Groups By (sort grouped data).

  5. 选择(指定要返回的字段或属性)。Select (specify which fields or properties to return).

  6. 自动排序(按用户选择的属性对数据记录进行排序)。Auto-sort (sort data records by a property that the user has selected).

  7. 自动页面(检索用户选择的一小部分数据记录)。Auto-page (retrieve a subset of data records that were selected by the user).

您可以向 Where 属性添加条件以筛选从查询返回的数据记录。You can add conditions to the Where property to filter the data records that are returned from a query. 如果未设置 Where 属性,则 LinqDataSource 控件将从数据对象中检索每个记录。If the Where property is not set, the LinqDataSource control retrieves every record from the data object.

数据排序Ordering Data

使用 OrderBy 属性可以指定返回的数据的属性名称,以便进行排序。You use the OrderBy property to specify the names of properties from the returned data to sort by.

备注

如果将 LinqDataSource 控件与 SQL Server 2000SQL Server 2000SQL Server Compact 3.5SQL Server Compact 3.5 一起使用,并且 AutoPage 属性设置为 true,则必须在 OrderBy 属性中提供一个值。When you use the LinqDataSource control with SQL Server 2000SQL Server 2000 or SQL Server Compact 3.5SQL Server Compact 3.5 and the AutoPage property is set to true, you must provide a value in the OrderBy property. 默认情况下,AutoPage 属性为 trueBy default, the AutoPage property is true. 如果为 Select 属性分配一个值,则还必须在查询中返回的属性列表中包含所有标识列。If you assign a value to the Select property, you must also include all identity columns in the list of properties that is returned in the query.

数据分组Grouping Data

使用 GroupBy 属性可以指定哪些属性用于合并具有相同值的数据记录。You use the GroupBy property to specify which properties are used to consolidate data records that have the same values. 在对数据进行分组时,可以在 Select 属性中包含 KeyIt,它们是动态创建的属性。When you group data, you can include Key and It, which are dynamically created properties, in the Select property. Key 属性指的是用于对数据进行分组的属性中的值。The Key property refers to the values in the property or properties that were used to group the data. 例如,如果按名为 Category的属性分组,则 Key 属性将包含 Category 属性中的所有唯一值。For example, if you group by a property named Category, the Key property will contain all unique values in the Category property. It 属性指的是数据分组中的单个记录的集合。The It property refers to a collection of individual records in a grouping of data. 您可以循环访问 It 属性,以便检索在分组操作中合并的各个记录。You can iterate over the It property to retrieve the individual records that have been consolidated in the grouping operation. 例如,如果按名为 Category的属性分组,则 It 属性将包含在 Category 属性中共享公共值的所有单个记录。For example, if you group by a property named Category, the It property contains all the individual records that share a common value in the Category property.

使用 OrderGroupsBy 属性可指定用于对分组数据进行排序的属性。You use the OrderGroupsBy property to specify the properties to use for sorting the grouped data. 当对数据进行分组时,OrderBy 属性指定如何对分组数据中的单个记录进行排序。When you group data, the OrderBy property specifies how the individual records within the grouped data are sorted.

默认情况下,LinqDataSource 控件将从数据对象中检索所有属性的值。By default, the LinqDataSource control retrieves values for all the properties from a data object. 如果要使用可用属性的子集,则可以使用 Select 属性指定要返回的属性。You use the Select property to specify which properties to return if you want to work with a subset of available properties. 选择操作应用于 Where、Order By 和 Group By 操作之后。The Select operation is applied after the Where, Order By, and Group By operations. 因此,如果在 Select 子句中创建了别名,则该别名在其他子句中不可用。Therefore, if you create an aliased name in a Select clause, the alias is not available in the other clauses.

数据修改Data Modifications

您可以使用 EnableDeleteEnableInsertEnableUpdate 属性指定是否启用了数据修改。You can specify whether data modifications are enabled by using the EnableDelete, EnableInsert, and EnableUpdate properties. 用于从 LinqDataSource 控件中修改数据的用户界面通常是通过数据绑定控件(如 DetailsView 控件)提供的。The user interface for modifying data from a LinqDataSource control is typically provided through a data-bound control, such as a DetailsView control. 除了将 EnableDeleteEnableInsertEnableUpdate 设置为 true以外,还需要满足以下条件才能启用自动数据修改:In addition to setting EnableDelete, EnableInsert, or EnableUpdate to true, the following conditions are required to enable automatic data modifications:

可以通过两种方式限制在数据绑定控件中显示哪些属性。You can restrict which properties are displayed in a data-bound control in two ways. 可以将 Select 属性设置为部分属性,也可以通过添加 DataControlField 控件来定义数据绑定控件的字段。You can either set the Select property to a subset of properties, or you can define the fields for a data-bound control by adding DataControlField controls. 但是,如果设置 Select 属性,则表示不能启用自动更新、插入和删除操作。However, if you set the Select property, it means that automatic update, insert, and delete operations cannot be enabled. 如果要在使用可用属性的子集时启用自动数据修改,请不要设置 "Select" 属性。If you want to enable automatic data modifications while you work with a subset of available properties, do not set the Select property. 相反,从数据对象检索所有属性,并使用数据绑定控件来管理要显示的属性。Instead, retrieve all properties from the data object and manage which ones are displayed by using the data-bound control. 当使用 DetailsView 控件或 GridView 控件时,还必须将 AutoGenerateRowsAutoGenerateColumns 属性设置为 falseWhen you use the DetailsView control or the GridView control, you must also set the AutoGenerateRows or AutoGenerateColumns properties to false. 这会阻止数据绑定控件自动包含用于编辑和删除数据的按钮。This prevents the data-bound control from automatically including buttons for editing and deleting the data. 数据绑定控件中未显示的任何值都存储在视图状态中。Any values that are not displayed in the data-bound control are stored in view state. 当执行数据更新时,它们将以不更改的形式传递到数据源。They are passed unchanged to the data source when the data update is performed.

在运行时计算值Evaluating Values at Run Time

如果需要在运行时评估值以便对值进行排序、筛选或分组,则可以将参数添加到 WhereParametersGroupByParametersOrderGroupsByParametersOrderByParameters 集合。If you have to evaluate values at run time for ordering, filtering, or grouping values, you can add parameters to the WhereParameters, GroupByParameters, OrderGroupsByParameters, or OrderByParameters collections.

如果要指定默认值,可将参数添加到 InsertParameters 集合。If you want to specify default values, you can add parameters to the InsertParameters collection.

如果要在执行数据操作之前检查或修改值,您可以处理 DeletingInsertingSelectingUpdating 事件。If you want to examine or modify values before the data operation is executed, you can handle the Deleting, Inserting, Selecting, or Updating events. 您还可以处理这些事件,以便取消数据操作,或检查在基于用户输入设置数据类中的属性时发生的验证错误。You can also handle these events in order to cancel the data operation or to examine validation errors that occurred when you set properties in the data class based on user input.

若要在数据操作完成后检查值,请处理 DeletedInsertedSelectedUpdated 事件。To examine values after the data operation has finished, handle the Deleted, Inserted, Selected, or Updated events.

使用存储过程Working with Stored Procedures

通过为 Selecting 事件创建事件处理程序,使用 LinqDataSource 控件从存储过程中检索数据。You use the LinqDataSource control to retrieve data from a stored procedure by creating an event handler for the Selecting event. 在事件处理程序中,您可以在表示存储过程的数据上下文类中调用方法,并将结果设置为 LinqDataSourceSelectEventArgs 对象的 Result 属性。In the event handler, you call the method in the data context class that represents the stored procedure and set the result to the Result property of the LinqDataSourceSelectEventArgs object. 如果要对数据启用自动更新、插入和删除操作,则从方法返回的类型必须与 TableName 属性中指定的类型相匹配。If you want to enable automatic update, insert, and delete operations for the data, the type that is returned from the method must match the type that is specified in the TableName property. 有关创建数据上下文方法的详细信息,请参阅 如何:创建映射到存储过程和函数的 DataContext 方法(O/R 设计器)For more information about creating data context methods, see How to: Create DataContext methods mapped to stored procedures and functions (O/R Designer).

声明性语法Declarative Syntax

<asp:LinqDataSource  
    AutoGenerateOrderByClause="True|False"  
    AutoGenerateWhereClause="True|False"  
    AutoPage="True|False"  
    AutoSort="True|False"  
    ContextTypeName="string"  
    EnableDelete="True|False"  
    EnableInsert="True|False"  
    EnableTheming="True|False"  
    EnableUpdate="True|False"  
    EnableViewState="True|False"  
    GroupBy="string"  
    ID="string"  
    OnContextCreated="ContextCreated event handler"  
    OnContextCreating="ContextCreating event handler"  
    OnContextDisposing="ContextDisposing event handler"  
    OnDataBinding="DataBinding event handler"  
    OnDeleted="Deleted event handler"  
    OnDeleting="Deleting event handler"  
    OnDisposed="Disposed event handler"  
    OnInit="Init event handler"  
    OnInserted="Inserted event handler"  
    OnInserting="Inserting event handler"  
    OnLoad="Load event handler"  
    OnPreRender="PreRender event handler"  
    OnSelected="Selected event handler"  
    OnSelecting="Selecting event handler"  
    OnUnload="Unload event handler"  
    OnUpdated="Updated event handler"  
    OnUpdating="Updating event handler"  
    OrderBy="string"  
    runat="server"  
    Select="string"  
    SkinID="string"  
    StoreOriginalValuesInViewState="True|False"  
    TableName="string"  
    Visible="True|False"  
    Where="string"  
>  
        <GroupByParameters />  
        <InsertParameters />  
        <OrderByParameters />  
        <SelectParameters />  
        <WhereParameters />  
</asp:LinqDataSource>  

构造函数

LinqDataSource()

初始化 LinqDataSource 类的新实例。Initializes a new instance of the LinqDataSource class.

属性

Adapter

获取控件的浏览器特定适配器。Gets the browser-specific adapter for the control.

(继承自 Control)
AppRelativeTemplateSourceDirectory

获取或设置包含该控件的 PageUserControl 对象的应用程序相对虚拟目录。Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.

(继承自 Control)
AutoGenerateOrderByClause

获取或设置一个值,该值指示 LinqDataSource 控件是否根据 OrderByParameters 集合中的值动态创建 Order By 子句。Gets or sets a value that indicates whether the LinqDataSource control dynamically creates an Order By clause based on values in the OrderByParameters collection.

AutoGenerateWhereClause

获取或设置一个值,该值指示 LinqDataSource 控件是否基于 WhereParameters 集合中定义的值来动态创建 Where 子句。Gets or sets a value that indicates whether the LinqDataSource control dynamically creates a Where clause based on values defined in the WhereParameters collection.

AutoPage

获取或设置一个值,该值指示 LinqDataSource 控件是否支持在运行时在数据的各部分之间导航。Gets or sets a value that indicates whether the LinqDataSource control supports navigation through sections of the data at run time.

AutoSort

获取或设置一个值,该值指示 LinqDataSource 控件是否支持在运行时对数据进行排序。Gets or sets a value that indicates whether the LinqDataSource control supports sorting the data at run time.

BindingContainer

获取包含该控件的数据绑定的控件。Gets the control that contains this control's data binding.

(继承自 Control)
ChildControlsCreated

获取一个值,该值指示是否已创建服务器控件的子控件。Gets a value that indicates whether the server control's child controls have been created.

(继承自 Control)
ClientID

获取由 ASP.NET 生成的服务器控件标识符。Gets the server control identifier generated by ASP.NET.

(继承自 DataSourceControl)
ClientIDMode

此属性不用于数据源控件。This property is not used for data source controls.

(继承自 DataSourceControl)
ClientIDSeparator

获取一个字符值,该值表示 ClientID 属性中使用的分隔符字符。Gets a character value representing the separator character used in the ClientID property.

(继承自 Control)
Context

为当前 Web 请求获取与服务器控件关联的 HttpContext 对象。Gets the HttpContext object associated with the server control for the current Web request.

(继承自 Control)
ContextTypeName

获取或设置包含属性(其值包含要检索的数据)的类型的名称。Gets or sets the name of the type that contains the property whose value has the data that you want to retrieve.

Controls

获取 ControlCollection 对象,该对象表示 UI 层次结构中的指定服务器控件的子控件。Gets a ControlCollection object that represents the child controls for a specified server control in the UI hierarchy.

(继承自 DataSourceControl)
DataItemContainer

如果命名容器实现 IDataItemContainer,则获取对命名容器的引用。Gets a reference to the naming container if the naming container implements IDataItemContainer.

(继承自 Control)
DataKeysContainer

如果命名容器实现 IDataKeysControl,则获取对命名容器的引用。Gets a reference to the naming container if the naming container implements IDataKeysControl.

(继承自 Control)
DeleteParameters

LinqDataSource 类不使用此属性。This property is not used by the LinqDataSource class.

DesignMode

获取一个值,该值指示是否正在使用设计图面上的一个控件。Gets a value indicating whether a control is being used on a design surface.

(继承自 Control)
EnableDelete

获取或设置一个值,该值指示是否可以通过 LinqDataSource 控件删除数据记录。Gets or sets a value that indicates whether data records can be deleted through the LinqDataSource control.

EnableInsert

获取或设置一个值,该值指示是否可以通过 LinqDataSource 控件插入数据记录。Gets or sets a value that indicates whether data records can be inserted through the LinqDataSource control.

EnableObjectTracking

获取或设置一个值,该值指示是否跟踪对数据上下文对象所做的更改。Gets or sets the value that indicates whether changes to the data context object are tracked.

EnableTheming

获取一个值,该值指示此控件是否支持主题。Gets a value indicating whether this control supports themes.

(继承自 DataSourceControl)
EnableUpdate

获取或设置一个值,该值指示是否可以通过 LinqDataSource 控件更新数据记录。Gets or sets a value that indicates whether data records can be updated through the LinqDataSource control.

EnableViewState

获取或设置一个值,该值指示服务器控件是否向发出请求的客户端保持自己的视图状态以及它所包含的任何子控件的视图状态。Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client.

(继承自 Control)
Events

获取控件的事件处理程序委托列表。Gets a list of event handler delegates for the control. 此属性是只读的。This property is read-only.

(继承自 Control)
GroupBy

获取或设置一个值,该值指定用于对检索到的数据进行分组的属性。Gets or sets a value that specifies which properties are used for grouping the retrieved data.

GroupByParameters

获取用于创建 Group By 子句的参数集合。Gets the collection of parameters that are used to create the Group By clause.

HasChildViewState

获取一个值,该值指示当前服务器控件的子控件是否具有任何已保存的视图状态设置。Gets a value indicating whether the current server control's child controls have any saved view-state settings.

(继承自 Control)
ID

获取或设置分配给服务器控件的编程标识符。Gets or sets the programmatic identifier assigned to the server control.

(继承自 Control)
IdSeparator

获取用于分隔控件标识符的字符。Gets the character used to separate control identifiers.

(继承自 Control)
InsertParameters

获取在插入操作过程中使用的参数的集合。Gets the collection of parameters that are used during an insert operation.

IsChildControlStateCleared

获取一个值,该值指示该控件中包含的控件是否具有控件状态。Gets a value indicating whether controls contained within this control have control state.

(继承自 Control)
IsTrackingViewState

获取一个值,用于指示服务器控件是否会将更改保存到其视图状态中。Gets a value that indicates whether the server control is saving changes to its view state.

(继承自 Control)
IsViewStateEnabled

获取一个值,该值指示是否为该控件启用了视图状态。Gets a value indicating whether view state is enabled for this control.

(继承自 Control)
LoadViewStateByID

获取一个值,该值指示控件是否通过 ID 而不是索引参与加载其视图状态。Gets a value indicating whether the control participates in loading its view state by ID instead of index.

(继承自 Control)
NamingContainer

获取对服务器控件的命名容器的引用,此引用创建唯一的命名空间,以区分具有相同 ID 属性值的服务器控件。Gets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same ID property value.

(继承自 Control)
OrderBy

获取或设置一个值,该值指定用于对检索到的数据进行排序的字段。Gets or sets a value that specifies which fields are used for ordering the retrieved data.

OrderByParameters

获取用于创建 Order By 子句的参数集合。Gets the collection of parameters that are used to create the Order By clause.

OrderGroupsBy

获取或设置用于对分组数据进行排序的字段。Gets or sets the fields that are used for ordering grouped data.

OrderGroupsByParameters

获取用于创建 Order Groups By 子句的参数集合。Gets the collection of parameters that are used to create the Order Groups By clause.

Page

获取对包含服务器控件的 Page 实例的引用。Gets a reference to the Page instance that contains the server control.

(继承自 Control)
Parent

获取对页 UI 层次结构中服务器控件的父控件的引用。Gets a reference to the server control's parent control in the page control hierarchy.

(继承自 Control)
RenderingCompatibility

获取一个值,该值指定呈现的 HTML 将与之兼容的 ASP.NET 版本。Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with.

(继承自 Control)
Select

获取或设置属性和计算值,它们包含在检索到的数据中。Gets or sets the properties and calculated values that are included in the retrieved data.

SelectParameters

获取在数据检索操作过程中使用的参数的集合。Gets the collection of parameters that are used during a data-retrieval operation.

Site

获取容器信息,该容器在呈现于设计图面上时承载当前控件。Gets information about the container that hosts the current control when rendered on a design surface.

(继承自 Control)
SkinID

获取要应用于 DataSourceControl 控件的外观。Gets the skin to apply to the DataSourceControl control.

(继承自 DataSourceControl)
StoreOriginalValuesInViewState

获取或设置一个值,该值指示数据源中的数据是否存储在视图状态中,以确保数据在更新或删除之前不会由其他进程更改。Gets or sets a value that indicates whether the data from the data source should be stored in view state to make sure that the data has not been changed by another process before it is updated or deleted.

TableName

获取或设置数据上下文类中的属性或字段的名称,该数据上下文类表示一个数据集合。Gets or sets the name of the property or field in the data context class that represents a data collection.

TemplateControl

获取或设置对包含该控件的模板的引用。Gets or sets a reference to the template that contains this control.

(继承自 Control)
TemplateSourceDirectory

获取包含当前服务器控件的 PageUserControl 的虚拟目录。Gets the virtual directory of the Page or UserControl that contains the current server control.

(继承自 Control)
UniqueID

获取服务器控件的唯一的、以分层形式限定的标识符。Gets the unique, hierarchically qualified identifier for the server control.

(继承自 Control)
UpdateParameters

LinqDataSource 类不使用此集合。This collection is not used by the LinqDataSource class.

ValidateRequestMode

获取或设置指示控件是否检查来自浏览器的客户端输入是否具有潜在危险值的值。Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values.

(继承自 Control)
ViewState

获取状态信息的字典,这些信息使您可以在同一页的多个请求间保存和还原服务器控件的视图状态。Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page.

(继承自 Control)
ViewStateIgnoresCase

获取一个值,该值指示 StateBag 对象是否不区分大小写。Gets a value that indicates whether the StateBag object is case-insensitive.

(继承自 Control)
ViewStateMode

获取或设置此控件的视图状态模式。Gets or sets the view-state mode of this control.

(继承自 Control)
Visible

获取或设置一个值,该值指示是否以可视化方式显示控件。Gets or sets a value indicating whether the control is visually displayed.

(继承自 DataSourceControl)
Where

获取或设置一个值,该值指定要将记录包含在检索到的数据中必须为真的条件。Gets or sets a value that specifies what conditions must be true for a record to be included in the retrieved data.

WhereParameters

获取用于创建 Where 子句的参数集合。Gets the collection of parameters that is used to create the Where clause.

方法

AddedControl(Control, Int32)

在子控件添加到 Control 对象的 Controls 集合后调用。Called after a child control is added to the Controls collection of the Control object.

(继承自 Control)
AddParsedSubObject(Object)

通知服务器控件,分析了一个元素(XML 或 HTML),并将该元素添加到服务器控件的 ControlCollection 对象中。Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object.

(继承自 Control)
ApplyStyleSheetSkin(Page)

将页样式表中定义的样式属性应用于控件。Applies the style properties that are defined in the page style sheet to the control.

(继承自 DataSourceControl)
BeginRenderTracing(TextWriter, Object)

开始输出数据的设计时追踪。Begins design-time tracing of rendering data.

(继承自 Control)
BuildProfileTree(String, Boolean)

收集有关服务器控件的信息并将该信息发送到 Trace 属性,在启用页的跟踪功能时将显示该属性。Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page.

(继承自 Control)
ClearCachedClientID()

将缓存的 ClientID 值设置为 nullSets the cached ClientID value to null.

(继承自 Control)
ClearChildControlState()

删除服务器控件的子控件的控件状态信息。Deletes the control-state information for the server control's child controls.

(继承自 Control)
ClearChildState()

删除服务器控件的所有子控件的视图状态和控件状态信息。Deletes the view-state and control-state information for all the server control's child controls.

(继承自 Control)
ClearChildViewState()

删除服务器控件的所有子控件的视图状态信息。Deletes the view-state information for all the server control's child controls.

(继承自 Control)
ClearEffectiveClientIDMode()

将当前控件实例和任何子控件的 ClientIDMode 属性设置为 InheritSets the ClientIDMode property of the current control instance and of any child controls to Inherit.

(继承自 Control)
CreateChildControls()

由 ASP.NET 页框架调用,以通知服务器控件在准备回发或呈现时使用基于撰写的实现来创建其所包含任何子控件。Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.

(继承自 Control)
CreateControlCollection()

创建用于存储子控件的集合。Creates a collection to store child controls.

(继承自 DataSourceControl)
CreateQueryableView()

返回可查询的视图。Returns a queryable view.

CreateView()

创建与此控件相关联的 LinqDataSourceView 类的新实例。Creates a new instance of the LinqDataSourceView class that is associated with this control.

DataBind()

将数据源绑定到调用的服务器控件及其所有子控件。Binds a data source to the invoked server control and all its child controls.

(继承自 Control)
DataBind(Boolean)

将数据源绑定到调用的服务器控件及其所有子控件,同时可以选择引发 DataBinding 事件。Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event.

(继承自 Control)
DataBindChildren()

将数据源绑定到服务器控件的子控件。Binds a data source to the server control's child controls.

(继承自 Control)
Delete(IDictionary, IDictionary)

执行删除操作。Performs a delete operation.

Dispose()

使服务器控件得以在从内存中释放之前执行最后的清理操作。Enables a server control to perform final clean up before it is released from memory.

(继承自 Control)
EndRenderTracing(TextWriter, Object)

结束输出数据的设计时追踪。Ends design-time tracing of rendering data.

(继承自 Control)
EnsureChildControls()

确定服务器控件是否包含子控件。Determines whether the server control contains child controls. 如果不包含,则创建子控件。If it does not, it creates child controls.

(继承自 Control)
EnsureID()

为尚未分配标识符的控件创建标识符。Creates an identifier for controls that do not have an identifier assigned.

(继承自 Control)
Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
FindControl(String)

在当前的命名容器中搜索带指定 id 参数的服务器控件。Searches the current naming container for a server control with the specified id parameter.

(继承自 DataSourceControl)
FindControl(String, Int32)

使用指定的 idpathOffset 参数(该参数有助于搜索)中指定的整数在当前命名容器中搜索服务器控件。Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. 不应重写此版本的 FindControl 方法。You should not override this version of the FindControl method.

(继承自 Control)
Focus()

为控件设置输入焦点。Sets input focus to the control.

(继承自 DataSourceControl)
GetDesignModeState()

获取控件的设计时数据。Gets design-time data for a control.

(继承自 Control)
GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetRouteUrl(Object)

获取与一组路由参数对应的 URL。Gets the URL that corresponds to a set of route parameters.

(继承自 Control)
GetRouteUrl(RouteValueDictionary)

获取与一组路由参数对应的 URL。Gets the URL that corresponds to a set of route parameters.

(继承自 Control)
GetRouteUrl(String, Object)

获取与一组路由参数以及某个路由名称对应的 URL。Gets the URL that corresponds to a set of route parameters and a route name.

(继承自 Control)
GetRouteUrl(String, RouteValueDictionary)

获取与一组路由参数以及某个路由名称对应的 URL。Gets the URL that corresponds to a set of route parameters and a route name.

(继承自 Control)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
GetUniqueIDRelativeTo(Control)

返回指定控件的 UniqueID 属性的前缀部分。Returns the prefixed portion of the UniqueID property of the specified control.

(继承自 Control)
GetView(String)

返回与 LinqDataSource 对象关联的数据源视图。Returns the data source view that is associated with the LinqDataSource object.

GetViewNames()

返回名称的集合,这些名称表示与 LinqDataSource 控件关联的视图对象的列表。Returns a collection of names that represents the list of view objects that are associated with the LinqDataSource control.

HasControls()

确定服务器控件是否包含任何子控件。Determines if the server control contains any child controls.

(继承自 DataSourceControl)
HasEvents()

返回一个值,该值指示是否为控件或任何子控件注册事件。Returns a value indicating whether events are registered for the control or any child controls.

(继承自 Control)
Insert(IDictionary)

执行插入操作。Performs an insert operation.

IsLiteralContent()

确定服务器控件是否只包含文字内容。Determines if the server control holds only literal content.

(继承自 Control)
LoadControlState(Object)

SaveControlState() 方法保存的上一个页请求还原控件状态信息。Restores control-state information from a previous page request that was saved by the SaveControlState() method.

(继承自 Control)
LoadViewState(Object)

加载必须保持的 LinqDataSource 控件中的值的状态。Loads the state of the values in the LinqDataSource control that must be persisted.

MapPathSecure(String)

检索虚拟路径(绝对的或相对的)映射到的物理路径。Retrieves the physical path that a virtual path, either absolute or relative, maps to.

(继承自 Control)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnBubbleEvent(Object, EventArgs)

确定服务器控件的事件是否沿页的 UI 服务器控件层次结构向上传递。Determines whether the event for the server control is passed up the page's UI server control hierarchy.

(继承自 Control)
OnDataBinding(EventArgs)

引发 DataBinding 事件。Raises the DataBinding event.

(继承自 Control)
OnInit(EventArgs)

初始化 LinqDataSource 对象。Initializes the LinqDataSource object.

OnLoad(EventArgs)

引发 Load 事件。Raises the Load event.

(继承自 Control)
OnPreRender(EventArgs)

引发 PreRender 事件。Raises the PreRender event.

(继承自 Control)
OnUnload(EventArgs)

引发 Unload 事件。Raises the Unload event.

OpenFile(String)

获取用于读取文件的 StreamGets a Stream used to read a file.

(继承自 Control)
RaiseBubbleEvent(Object, EventArgs)

将所有事件源及其信息分配给控件的父级。Assigns any sources of the event and its information to the control's parent.

(继承自 Control)
RaiseDataSourceChangedEvent(EventArgs)

引发 DataSourceChanged 事件。Raises the DataSourceChanged event.

(继承自 DataSourceControl)
RemovedControl(Control)

Control 对象的 Controls 集合移除子控件后调用。Called after a child control is removed from the Controls collection of the Control object.

(继承自 Control)
Render(HtmlTextWriter)

将服务器控件内容发送到给定的 HtmlTextWriter 对象,该对象可编写将在客户端呈现的内容。Sends server control content to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

(继承自 Control)
RenderChildren(HtmlTextWriter)

将服务器控件子级的内容输出到提供的 HtmlTextWriter 对象,此对象编写将在客户端呈现的内容。Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

(继承自 Control)
RenderControl(HtmlTextWriter)

将服务器控件内容输出到所提供的 HtmlTextWriter 对象,如果启用了跟踪,则还将存储有关该控件的跟踪信息。Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled.

(继承自 DataSourceControl)
RenderControl(HtmlTextWriter, ControlAdapter)

使用提供的 HtmlTextWriter 对象将服务器控件内容输出到提供的 ControlAdapter 对象。Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object.

(继承自 Control)
ResolveAdapter()

获取负责呈现指定控件的控件适配器。Gets the control adapter responsible for rendering the specified control.

(继承自 Control)
ResolveClientUrl(String)

获取浏览器可以使用的 URL。Gets a URL that can be used by the browser.

(继承自 Control)
ResolveUrl(String)

将 URL 转换为在请求客户端可用的 URL。Converts a URL into one that is usable on the requesting client.

(继承自 Control)
SaveControlState()

保存将页面回发到服务器之后发生的所有服务器控件状态更改。Saves any server control state changes that have occurred since the time the page was posted back to the server.

(继承自 Control)
SaveViewState()

保存 LinqDataSource 控件的当前视图状态。Saves the current view state of the LinqDataSource control.

SetDesignModeState(IDictionary)

为控件设置设计时数据。Sets design-time data for a control.

(继承自 Control)
SetRenderMethodDelegate(RenderMethod)

分配事件处理程序委托,以将服务器控件及其内容呈现到父控件中。Assigns an event handler delegate to render the server control and its content into its parent control.

(继承自 Control)
SetTraceData(Object, Object)

使用跟踪数据键和跟踪数据值,为呈现数据的设计时追踪设置跟踪数据。Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value.

(继承自 Control)
SetTraceData(Object, Object, Object)

使用跟踪对象、跟踪数据键和跟踪数据值,为呈现数据的设计时追踪设置跟踪数据。Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value.

(继承自 Control)
ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)
TrackViewState()

跟踪对 LinqDataSource 控件的视图状态的更改,以便可将这些更改存储在该控件的 StateBag 对象中。Tracks view state changes to the LinqDataSource control so that the changes can be stored in the StateBag object for the control.

Update(IDictionary, IDictionary, IDictionary)

执行更新操作。Performs an update operation.

事件

ContextCreated

在创建上下文类型对象实例后发生。Occurs after an instance of the context type object is created.

ContextCreating

在创建上下文类型对象实例前发生。Occurs before an instance of the context type object is created.

ContextDisposing

在释放上下文类型对象前发生。Occurs before disposing the context type object.

DataBinding

当服务器控件绑定到数据源时发生。Occurs when the server control binds to a data source.

(继承自 Control)
Deleted

完成删除操作后发生。Occurs when a delete operation has finished.

Deleting

执行删除操作前发生。Occurs before a delete operation.

Disposed

当从内存释放服务器控件时发生,这是请求 ASP.NET 页时服务器控件生存期的最后阶段。Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested.

(继承自 Control)
Init

当服务器控件初始化时发生;初始化是控件生存期的第一步。Occurs when the server control is initialized, which is the first step in its lifecycle.

(继承自 Control)
Inserted

完成插入操作后发生。Occurs when an insert operation has finished.

Inserting

执行插入操作前发生。Occurs before an insert operation.

Load

当服务器控件加载到 Page 对象中时发生。Occurs when the server control is loaded into the Page object.

(继承自 Control)
PreRender

在加载 Control 对象之后、呈现之前发生。Occurs after the Control object is loaded but prior to rendering.

(继承自 Control)
Selected

数据检索操作完成后发生。Occurs when a data retrieval operation has finished.

Selecting

执行数据检索操作前发生。Occurs before a data-retrieval operation.

Unload

当服务器控件从内存中卸载时发生。Occurs when the server control is unloaded from memory.

(继承自 Control)
Updated

完成更新操作后发生。Occurs when an update operation has finished.

Updating

执行更新操作前发生。Occurs before an update operation.

显式界面实现

IControlBuilderAccessor.ControlBuilder

有关此成员的说明,请参见 ControlBuilderFor a description of this member, see ControlBuilder.

(继承自 Control)
IControlDesignerAccessor.GetDesignModeState()

有关此成员的说明,请参见 GetDesignModeState()For a description of this member, see GetDesignModeState().

(继承自 Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

有关此成员的说明,请参见 SetDesignModeState(IDictionary)For a description of this member, see SetDesignModeState(IDictionary).

(继承自 Control)
IControlDesignerAccessor.SetOwnerControl(Control)

有关此成员的说明,请参见 SetOwnerControl(Control)For a description of this member, see SetOwnerControl(Control).

(继承自 Control)
IControlDesignerAccessor.UserData

有关此成员的说明,请参见 UserDataFor a description of this member, see UserData.

(继承自 Control)
IDataBindingsAccessor.DataBindings

有关此成员的说明,请参见 DataBindingsFor a description of this member, see DataBindings.

(继承自 Control)
IDataBindingsAccessor.HasDataBindings

有关此成员的说明,请参见 HasDataBindingsFor a description of this member, see HasDataBindings.

(继承自 Control)
IDataSource.DataSourceChanged

当数据源控件以某种影响数据绑定控件的方式发生更改时发生。Occurs when a data source control has changed in a way that affects data-bound controls.

(继承自 DataSourceControl)
IDataSource.GetView(String)

获取与 DataSourceControl 控件关联的指定 DataSourceView 对象。Gets the named DataSourceView object associated with the DataSourceControl control. 有些数据源控件只支持一个视图,有些则支持多个视图。Some data source controls support only one view, while others support more than one.

(继承自 DataSourceControl)
IDataSource.GetViewNames()

获取名称的集合,表示与 DataSourceControl 控件关联的 DataSourceView 对象的列表。Gets a collection of names, representing the list of DataSourceView objects associated with the DataSourceControl control.

(继承自 DataSourceControl)
IDynamicDataSource.ContextType

有关此成员的说明,请参见 IDynamicDataSourceFor a description of this member, see IDynamicDataSource.

IDynamicDataSource.EntitySetName

有关此成员的说明,请参见 IDynamicDataSourceFor a description of this member, see IDynamicDataSource.

IDynamicDataSource.Exception

有关此成员的说明,请参见 IDynamicDataSourceFor a description of this member, see IDynamicDataSource.

IExpressionsAccessor.Expressions

有关此成员的说明,请参见 ExpressionsFor a description of this member, see Expressions.

(继承自 Control)
IExpressionsAccessor.HasExpressions

有关此成员的说明,请参见 HasExpressionsFor a description of this member, see HasExpressions.

(继承自 Control)
IListSource.ContainsListCollection

指示数据源控件是否与一个或多个数据列表相关联。Indicates whether the data source control is associated with one or more lists of data.

(继承自 DataSourceControl)
IListSource.GetList()

获取可用作数据列表的源的数据源控件列表。Gets a list of data source controls that can be used as sources of lists of data.

(继承自 DataSourceControl)
IParserAccessor.AddParsedSubObject(Object)

有关此成员的说明,请参见 AddParsedSubObject(Object)For a description of this member, see AddParsedSubObject(Object).

(继承自 Control)

扩展方法

ExpandDynamicWhereParameters(IDynamicDataSource)

将动态筛选器扩展到可供数据源使用的 Where 参数中。Expands dynamic filters into Where parameters that are usable by the data source.

FindDataSourceControl(Control)

返回与指定控件的数据控件关联的数据源。Returns the data source that is associated with the data control for the specified control.

FindFieldTemplate(Control, String)

返回指定控件的命名容器中指定列的字段模板。Returns the field template for the specified column in the specified control's naming container.

FindMetaTable(Control)

返回包含数据控件的元表对象。Returns the metatable object for the containing data control.

GetDefaultValues(IDataSource)

为指定数据源获取默认值的集合。Gets the collection of the default values for the specified data source.

GetMetaTable(IDataSource)

获取指定数据源对象中表的元数据。Gets the metadata for a table in the specified data source object.

GetTable(IDynamicDataSource)

返回与指定数据源控件关联的 MetaTable 对象。Returns the MetaTable object that is associated with the specified data source control.

LoadWith<TEntity>(LinqDataSource)

设置 LINQ-to-SQL 数据源的 DataLoadOptions 值,以强制加载所有外键实体。Sets the DataLoadOptions value of a LINQ-to-SQL data source to force all the foreign-key entities to be loaded.

LoadWithForeignKeys(LinqDataSource, Type)

设置 LINQ-to-SQL 数据源的 DataLoadOptions 值,以强制加载所有外键实体。Sets the DataLoadOptions value of a LINQ-to-SQL data source to force all the foreign-key entities to be loaded.

TryGetMetaTable(IDataSource, MetaTable)

确定表元数据是否可用。Determines whether table metadata is available.

适用于

另请参阅