AccessDataSource 类

定义

表示与数据绑定控件结合使用的 Microsoft Access 数据库。Represents a Microsoft Access database for use with data-bound controls.

public ref class AccessDataSource : System::Web::UI::WebControls::SqlDataSource
[System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.AccessDataSource))]
public class AccessDataSource : System.Web.UI.WebControls.SqlDataSource
type AccessDataSource = class
    inherit SqlDataSource
Public Class AccessDataSource
Inherits SqlDataSource
继承
属性

示例

下面的代码示例演示了与GridView控件一起使用的常见显示和更新方案。The following code example demonstrates a common display and update scenario with the GridView control. 将属性设置为相应的 SQL 查询, 并GridView在控件中显示 Northwind 数据库中的数据。 SelectCommandThe SelectCommand property is set to an appropriate SQL query, and data from the Northwind database is displayed in the GridView control. 由于还UpdateCommand指定了属性AutoGenerateEditButton且属性设置为true, 因此你可以在不使用其他代码的情况下编辑和更新记录。Because a UpdateCommand property is also specified and the AutoGenerateEditButton property is set to true, you can edit and update the records with no additional code. DataKeyNames BoundField GridView控件处理UpdateParameters向集合添加参数的句柄; 控件首先传递对象的参数值, 后跟由指定的字段的值。 GridView知识产权.The GridView control handles adding parameters to the UpdateParameters collection; the GridView control passes the parameter values for the BoundField objects first, followed by the values of fields that are specified by the DataKeyNames property. GridView 自动Update调用方法。The GridView calls the Update method automatically. 如果要对参数进行显式排序, 请UpdateParameters AccessDataSource在上指定集合。If you want to order the parameters, explicitly, specify an UpdateParameters collection on the AccessDataSource.

<%@Page  Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">

      <asp:accessdatasource
        id="AccessDataSource1"
        runat="server"
        datasourcemode="DataSet"
        datafile="~/App_Data/Northwind.mdb"
        selectcommand="SELECT EmployeeID,FirstName,LastName,Title FROM Employees"
        updatecommand="Update Employees SET FirstName=?,LastName=?,Title=? WHERE EmployeeID=@EmployeeID">
      </asp:accessdatasource>

      <asp:gridview
        id="GridView1"
        runat="server"
        autogeneratecolumns="False"
        datakeynames="EmployeeID"
        autogenerateeditbutton="True"
        datasourceid="AccessDataSource1">
        <columns>
          <asp:boundfield headertext="First Name" datafield="FirstName" />
          <asp:boundfield headertext="Last Name" datafield="LastName" />
          <asp:boundfield headertext="Title" datafield="Title" />
        </columns>
      </asp:gridview>

    </form>
  </body>
</html>
<%@Page  Language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">

      <asp:accessdatasource
        id="AccessDataSource1"
        runat="server"
        datasourcemode="DataSet"
        datafile="~/App_Data/Northwind.mdb"
        selectcommand="SELECT EmployeeID,FirstName,LastName,Title FROM Employees"
        updatecommand="Update Employees SET FirstName=?,LastName=?,Title=? WHERE EmployeeID=@EmployeeID">
      </asp:accessdatasource>

      <asp:gridview
        id="GridView1"
        runat="server"
        autogeneratecolumns="False"
        datakeynames="EmployeeID"
        autogenerateeditbutton="True"
        datasourceid="AccessDataSource1">
        <columns>
          <asp:boundfield headertext="First Name" datafield="FirstName" />
          <asp:boundfield headertext="Last Name" datafield="LastName" />
          <asp:boundfield headertext="Title" datafield="Title" />
        </columns>
      </asp:gridview>

    </form>
  </body>
</html>

注解

AccessDataSource类是适用于 Microsoft Access 数据库的数据源控件。The AccessDataSource class is a data source control that works with Microsoft Access databases. 与其基类SqlDataSource AccessDataSource一样, 控件使用 SQL 查询来执行数据检索。Like its base class, SqlDataSource, the AccessDataSource control uses SQL queries to perform data retrieval.

AccessDataSource控件的唯一特征之一是不ConnectionString设置属性。One of the unique characteristics of the AccessDataSource control is that you do not set the ConnectionString property. 只需在DataFile属性中设置 Access (.mdb) 文件的位置AccessDataSource , 并处理与数据库的基础连接。All you need to do is set the location of the Access (.mdb) file in the DataFile property and the AccessDataSource takes care of the underlying connection to the database. 应将 Access 数据库置于网站的 App_Data 目录中, 并通过相对路径引用这些数据库 (例如~/App_Data/Northwind.mdb)。You should place Access databases in the App_Data directory of the Web site and reference them by a relative path (for example, ~/App_Data/Northwind.mdb). 此位置为数据文件提供了额外的安全性, 因为它们不是由客户端 Web 浏览器直接请求的。This location offers additional security for data files, because they are not served if they are requested directly by the client Web browser.

类不支持连接到受用户名或密码保护的 Access 数据库, 因为您不能ConnectionString设置属性。 AccessDataSourceThe AccessDataSource class does not support connecting to Access databases that are protected by a user name or password, because you cannot set the ConnectionString property. 如果访问数据库受用户名或密码保护, 请使用SqlDataSource控件连接到该数据库, 以便可以指定完整的连接字符串。If your Access database is protected by a user name or password, use the SqlDataSource control to connect to it so that you can specify a complete connection string.

使用数据绑定控件的属性将数据绑定控件绑定到。 DataSourceID AccessDataSourceYou bind data-bound controls to an AccessDataSource using the DataSourceID property of the data-bound control. 有关将数据绑定控件绑定到数据源控件的详细信息, 请参阅使用数据源控件绑定到数据For more information about binding a data-bound control to data source controls, see Binding to Data Using a Data Source Control.

由于控件仅特定于一个数据库产品, 因此它始终使用相同的提供程序System.Data.OleDb -.net 数据提供程序。 AccessDataSourceBecause the AccessDataSource control is specific to only one database product, it always uses the same provider - the System.Data.OleDb .NET data provider. 出于此原因, 该ProviderName属性是只读的。For this reason, the ProviderName property is read-only. 使用System.Data.OleDb提供程序时, 参数化的 sql 语句中参数的顺序很重要; 在SelectCommandUpdateCommand InsertCommand、和DeleteCommand属性中指定的任何参数化 SQL 查询都必须匹配相应参数集合中Parameter的任何对象的顺序。When using the System.Data.OleDb provider, the order of the parameters in a parameterized SQL statement is significant; any parameterized SQL queries that you specify in the SelectCommand, UpdateCommand, InsertCommand, and DeleteCommand properties must match the order of any Parameter objects that are in the corresponding parameter collection. 如果未指定AccessDataSource参数集合, 则提供给这些操作的参数的顺序必须与它们在基础 SQL 语句中出现的顺序一致。If no parameter collection is specified on the AccessDataSource, the order of parameters that are supplied to these operations must match the order in which they appear in the underlying SQL statement. 有关详细信息, 请参阅将参数与 SqlDataSource 控件一起使用For more information, see Using Parameters with the SqlDataSource Control.

AccessDataSource控件支持其基类支持的相同缓存行为。The AccessDataSource control supports the same caching behavior that its base class supports. 使用缓存来提高使用AccessDataSource控件的页面的性能。Use caching to increase the performance of pages that use the AccessDataSource control. 有关数据源缓存的详细信息, 请参阅使用数据源控件缓存数据For more information about data source caching, see Caching Data Using Data Source Controls.

下表描述了AccessDataSource控件的功能。The following table describes the features of the AccessDataSource control.

功能Capability 要求Requirements
排序Sorting 将属性设置为DataSet值。 DataSourceModeSet the DataSourceMode property to the DataSet value.
筛选Filtering 将属性设置为在调用Select方法时用于筛选数据的筛选表达式。 FilterExpressionSet the FilterExpression property to a filtering expression used to filter the data when the Select method is called.
分页Paging AccessDataSource不支持对 Access 数据库进行直接分页操作。The AccessDataSource does not support direct paging operations on an Access database. GridView AccessDataSource如果将属性设置DataSet为值, 则数据绑定控件 (如) 可以对返回的项进行分页。 DataSourceModeA data-bound control, such as the GridView, can page over the items returned by the AccessDataSource, if the DataSourceMode property is set to the DataSet value.
UpdatingUpdating UpdateCommand将属性设置为用于更新数据的 SQL 语句。Set the UpdateCommand property to a SQL statement used to update data. 此语句通常是参数化的。This statement is typically parameterized.
正在删除Deleting DeleteCommand将属性设置为用于删除数据的 SQL 语句。Set the DeleteCommand property to a SQL statement used to delete data. 此语句通常是参数化的。This statement is typically parameterized.
插入Inserting InsertCommand将属性设置为用于插入数据的 SQL 语句。Set the InsertCommand property to a SQL statement used to insert data. 此语句通常是参数化的。This statement is typically parameterized.
缓存Caching true CacheExpirationPolicy DataSet EnableCaching CacheDuration根据缓存数据所需的缓存行为, 将属性设置为值,将属性设置为,并将和属性设置为。DataSourceModeSet the DataSourceMode property to the DataSet value, the EnableCaching property to true, and the CacheDuration and CacheExpirationPolicy properties according to the caching behavior you want for your cached data.

与所有数据源控件一样, AccessDataSource控件与强类型化数据源视图类相关联。As with all data source controls, the AccessDataSource control is associated with a strongly typed data source view class. 正如AccessDataSource控件SqlDataSource扩展控件AccessDataSourceView 一样SqlDataSourceView , 类扩展类。Just as the AccessDataSource control extends the SqlDataSource control, the AccessDataSourceView class extends the SqlDataSourceView class. 类将重写几SqlDataSourceView个使用System.Data.OleDb .net 数据访问接口的方法。 AccessDataSourceViewThe AccessDataSourceView class overrides a few of the SqlDataSourceView methods to use the System.Data.OleDb .NET data provider.

AccessDataSource控件没有可视化呈现; 它作为控件实现, 以实现声明性持久性, 并允许 (可选) 参与状态管理。There is no visual rendering of the AccessDataSource control; it is implemented as a control to enable declarative persistence and to permit, optionally, participation in state management. 因此, 不能设置支持可视功能的属性, 例如EnableThemingSkinID属性。As a result, you cannot set properties that support visual features, such as the EnableTheming and SkinID properties.

声明性语法Declarative Syntax

<asp:AccessDataSource  
    CacheDuration="string|Infinite"  
    CacheExpirationPolicy="Absolute|Sliding"  
    CacheKeyDependency="string"  
    CancelSelectOnNullParameter="True|False"  
    ConflictDetection="OverwriteChanges|CompareAllValues"  
    DataFile="uri"  
    DataSourceMode="DataReader|DataSet"  
    DeleteCommand="string"  
    DeleteCommandType="Text|StoredProcedure"  
    EnableCaching="True|False"  
    EnableTheming="True|False"  
    EnableViewState="True|False"  
    FilterExpression="string"  
    ID="string"  
    InsertCommand="string"  
    InsertCommandType="Text|StoredProcedure"  
    OldValuesParameterFormatString="string"  
    OnDataBinding="DataBinding event handler"  
    OnDeleted="Deleted event handler"  
    OnDeleting="Deleting event handler"  
    OnDisposed="Disposed event handler"  
    OnFiltering="Filtering 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"  
    runat="server"  
    SelectCommand="string"  
    SelectCommandType="Text|StoredProcedure"  
    SkinID="string"  
    SortParameterName="string"  
    UpdateCommand="string"  
    UpdateCommandType="Text|StoredProcedure"  
    Visible="True|False"  
>  
        <DeleteParameters>  
                <asp:ControlParameter  
                    ControlID="string"  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|  
                        ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:CookieParameter  
                    ConvertEmptyStringToNull="True|False"  
                    CookieName="string"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|  
                        ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:FormParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    FormField="string"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:Parameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64  
                        |Single|Double|Decimal|DateTime|String"  
                />  
                <asp:ProfileParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:QueryStringParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    QueryStringField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:SessionParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    SessionField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
        </DeleteParameters>  
        <FilterParameters>  
                <asp:ControlParameter  
                    ControlID="string"  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:CookieParameter  
                    ConvertEmptyStringToNull="True|False"  
                    CookieName="string"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:FormParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    FormField="string"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:Parameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:ProfileParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:QueryStringParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    QueryStringField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:SessionParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    SessionField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
        </FilterParameters>  
        <InsertParameters>  
                <asp:ControlParameter  
                    ControlID="string"  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:CookieParameter  
                    ConvertEmptyStringToNull="True|False"  
                    CookieName="string"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:FormParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    FormField="string"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:Parameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:ProfileParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:QueryStringParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    QueryStringField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:SessionParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    SessionField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
        </InsertParameters>  
        <SelectParameters>  
                <asp:ControlParameter  
                    ControlID="string"  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:CookieParameter  
                    ConvertEmptyStringToNull="True|False"  
                    CookieName="string"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:FormParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    FormField="string"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:Parameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:ProfileParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:QueryStringParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    QueryStringField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:SessionParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    SessionField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
        </SelectParameters>  
        <UpdateParameters>  
                <asp:ControlParameter  
                    ControlID="string"  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:CookieParameter  
                    ConvertEmptyStringToNull="True|False"  
                    CookieName="string"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:FormParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    FormField="string"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:Parameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:ProfileParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    PropertyName="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                       Single|Double|Decimal|DateTime|String"  
                />  
                <asp:QueryStringParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    QueryStringField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
                <asp:SessionParameter  
                    ConvertEmptyStringToNull="True|False"  
                    DefaultValue="string"  
                    Direction="Input|Output|InputOutput|ReturnValue"  
                    Name="string"  
                    SessionField="string"  
                    Size="integer"  
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|  
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|  
                        Single|Double|Decimal|DateTime|String"  
                />  
        </UpdateParameters>  
</asp:AccessDataSource>  

构造函数

AccessDataSource()

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

AccessDataSource(String, String)

使用指定数据文件路径和 Select 命令初始化 AccessDataSource 类的新实例。Initializes a new instance of the AccessDataSource class with the specified data file path and Select command.

属性

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)
BindingContainer

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

(继承自 Control)
CacheDuration

获取或设置以秒为单位的一段时间,它是数据源控件缓存 Select(DataSourceSelectArguments) 方法所检索到的数据的时间。Gets or sets the length of time, in seconds, that the data source control caches data that is retrieved by the Select(DataSourceSelectArguments) method.

(继承自 SqlDataSource)
CacheExpirationPolicy

获取或设置缓存的到期行为,该行为与持续时间组合在一起可以描述数据源控件所用缓存的行为。Gets or sets the cache expiration behavior that, when combined with the duration, describes the behavior of the cache that the data source control uses.

(继承自 SqlDataSource)
CacheKeyDependency

获取或设置一个用户定义的键依赖项,该键依赖项链接到数据源控件创建的所有数据缓存对象。Gets or sets a user-defined key dependency that is linked to all data cache objects that are created by the data source control. 当键到期时,所有缓存对象都显式到期。All cache objects are explicitly expired when the key is expired.

(继承自 SqlDataSource)
CancelSelectOnNullParameter

获取或设置一个值,该值指示当 SelectParameters 集合中包含的任何一个参数为 null 时,是否取消数据检索操作。Gets or sets a value indicating whether a data retrieval operation is canceled when any parameter that is contained in the SelectParameters collection evaluates to null.

(继承自 SqlDataSource)
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)
ConflictDetection

获取或设置值,该值指示操作期间基础数据库中的一行数据更改时,SqlDataSource 控件如何执行更新和删除。Gets or sets the value indicating how the SqlDataSource control performs updates and deletes when data in a row in the underlying database changes during the time of the operation.

(继承自 SqlDataSource)
ConnectionString

获取用来连接到 Microsoft Access 数据库的连接字符串。Gets the connection string that is used to connect to the Microsoft Access database.

Context

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

(继承自 Control)
Controls

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

(继承自 DataSourceControl)
DataFile

获取或设置 Microsoft Access .mdb 文件的位置。Gets or sets the location of the Microsoft Access .mdb file.

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)
DataSourceMode

获取或设置 SqlDataSource 控件获取数据所用的数据检索模式。Gets or sets the data retrieval mode that the SqlDataSource control uses to fetch data.

(继承自 SqlDataSource)
DeleteCommand

获取或设置 SqlDataSource 控件从基础数据库删除数据所用的 SQL 字符串。Gets or sets the SQL string that the SqlDataSource control uses to delete data from the underlying database.

(继承自 SqlDataSource)
DeleteCommandType

获取或设置一个值,该值指示 DeleteCommand 属性中的文本是 SQL 语句还是存储过程的名称。Gets or sets a value indicating whether the text in the DeleteCommand property is an SQL statement or the name of a stored procedure.

(继承自 SqlDataSource)
DeleteParameters

从与 DeleteCommand 控件相关联的 SqlDataSourceView 对象获取包含 SqlDataSource 属性所使用的参数的参数集合。Gets the parameters collection that contains the parameters that are used by the DeleteCommand property from the SqlDataSourceView object that is associated with the SqlDataSource control.

(继承自 SqlDataSource)
DesignMode

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

(继承自 Control)
EnableCaching

获取或设置一个值,该值指示 SqlDataSource 控件是否启用数据缓存。Gets or sets a value indicating whether the SqlDataSource control has data caching enabled.

(继承自 SqlDataSource)
EnableTheming

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

(继承自 DataSourceControl)
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)
FilterExpression

获取或设置调用 Select(DataSourceSelectArguments) 方法时应用的筛选表达式。Gets or sets a filtering expression that is applied when the Select(DataSourceSelectArguments) method is called.

(继承自 SqlDataSource)
FilterParameters

获取与 FilterExpression 字符串中的任何参数占位符关联的参数的集合。Gets a collection of parameters that are associated with any parameter placeholders that are in the FilterExpression string.

(继承自 SqlDataSource)
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)
InsertCommand

获取或设置 SqlDataSource 控件将数据插入基础数据库所用的 SQL 字符串。Gets or sets the SQL string that the SqlDataSource control uses to insert data into the underlying database.

(继承自 SqlDataSource)
InsertCommandType

获取或设置一个值,该值指示 InsertCommand 属性中的文本是 SQL 语句还是存储过程的名称。Gets or sets a value indicating whether the text in the InsertCommand property is an SQL statement or the name of a stored procedure.

(继承自 SqlDataSource)
InsertParameters

从与 InsertCommand 控件相关联的 SqlDataSourceView 对象获取包含 SqlDataSource 属性所使用的参数的参数集合。Gets the parameters collection that contains the parameters that are used by the InsertCommand property from the SqlDataSourceView object that is associated with the SqlDataSource control.

(继承自 SqlDataSource)
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)
OldValuesParameterFormatString

获取或设置一个格式字符串,该字符串应用于传递给 Delete()Update() 方法的所有参数的名称。Gets or sets a format string to apply to the names of any parameters that are passed to the Delete() or Update() method.

(继承自 SqlDataSource)
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)
ProviderName

获取用于连接到 Microsoft Access 数据库的 AccessDataSource 控件的 .NET 数据提供程序的名称。Gets the name of the .NET data provider that the AccessDataSource control uses to connect to a Microsoft Access database.

RenderingCompatibility

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

(继承自 Control)
SelectCommand

获取或设置 SqlDataSource 控件从基础数据库检索数据所用的 SQL 字符串。Gets or sets the SQL string that the SqlDataSource control uses to retrieve data from the underlying database.

(继承自 SqlDataSource)
SelectCommandType

获取或设置一个值,该值指示 SelectCommand 属性中的文本是 SQL 查询还是存储过程的名称。Gets or sets a value indicating whether the text in the SelectCommand property is an SQL query or the name of a stored procedure.

(继承自 SqlDataSource)
SelectParameters

从与 SelectCommand 控件相关联的 SqlDataSourceView 对象获取包含 SqlDataSource 属性所使用的参数的参数集合。Gets the parameters collection that contains the parameters that are used by the SelectCommand property from the SqlDataSourceView object that is associated with the SqlDataSource control.

(继承自 SqlDataSource)
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)
SortParameterName

获取或设置存储过程参数的名称,在使用存储过程执行数据检索时,该存储过程参数用于对检索到的数据进行排序。Gets or sets the name of a stored procedure parameter that is used to sort retrieved data when data retrieval is performed using a stored procedure.

(继承自 SqlDataSource)
SqlCacheDependency

SqlCacheDependency 属性重写 SqlCacheDependency 属性。The SqlCacheDependency property overrides the SqlCacheDependency property.

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)
UpdateCommand

获取或设置 SqlDataSource 控件更新基础数据库中的数据所用的 SQL 字符串。Gets or sets the SQL string that the SqlDataSource control uses to update data in the underlying database.

(继承自 SqlDataSource)
UpdateCommandType

获取或设置一个值,该值指示 UpdateCommand 属性中的文本是 SQL 语句还是存储过程的名称。Gets or sets a value indicating whether the text in the UpdateCommand property is an SQL statement or the name of a stored procedure.

(继承自 SqlDataSource)
UpdateParameters

从与 UpdateCommand 控件相关联的 SqlDataSourceView 控件获取包含 SqlDataSource 属性所使用的参数的参数集合。Gets the parameters collection that contains the parameters that are used by the UpdateCommand property from the SqlDataSourceView control that is associated with the SqlDataSource control.

(继承自 SqlDataSource)
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)

方法

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)
CreateDataSourceView(String)

创建与数据源控件关联的数据源视图对象。Creates a data source view object that is associated with the data source 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()

使用 DeleteCommand SQL 字符串和 DeleteParameters 集合中的所有参数执行删除操作。Performs a delete operation using the DeleteCommand SQL string and any parameters that are in the DeleteParameters collection.

(继承自 SqlDataSource)
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)
GetDbProviderFactory()

检索与 .NET 数据提供程序(由 DbProviderFactory 属性标识)关联的 ProviderName 对象。Retrieves a DbProviderFactory object that is associated with the .NET data provider that is identified by the ProviderName property.

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)

获取与数据源控件关联的命名的数据源视图。Gets the named data source view that is associated with the data source control.

(继承自 SqlDataSource)
GetViewNames()

获取名称的集合,这些名称表示与 SqlDataSource 控件关联的视图对象的列表。Gets a collection of names representing the list of view objects that are associated with the SqlDataSource control.

(继承自 SqlDataSource)
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()

使用 InsertCommand SQL 字符串和 InsertParameters 集合中的所有参数执行插入操作。Performs an insert operation using the InsertCommand SQL string and any parameters that are in the InsertParameters collection.

(继承自 SqlDataSource)
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)

加载 SqlDataSource 控件中需要保留的属性的状态。Loads the state of the properties in the SqlDataSource control that need to be persisted.

(继承自 SqlDataSource)
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)

LoadComplete 事件处理程序添加到包含 Page 控件的 SqlDataSource 控件中。Adds a LoadComplete event handler to the Page control that contains the SqlDataSource control.

(继承自 SqlDataSource)
OnLoad(EventArgs)

引发 Load 事件。Raises the Load event.

(继承自 Control)
OnPreRender(EventArgs)

引发 PreRender 事件。Raises the PreRender event.

(继承自 Control)
OnUnload(EventArgs)

引发 Unload 事件。Raises the Unload event.

(继承自 Control)
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()

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

(继承自 SqlDataSource)
Select(DataSourceSelectArguments)

通过使用 SelectCommand SQL 字符串以及 SelectParameters 集合中的任何参数,从基础数据库中检索数据。Retrieves data from the underlying database by using the SelectCommand SQL string and any parameters that are in the SelectParameters collection.

(继承自 SqlDataSource)
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()

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

(继承自 SqlDataSource)
Update()

使用 UpdateCommand SQL 字符串和 UpdateParameters 集合中的所有参数执行更新操作。Performs an update operation using the UpdateCommand SQL string and any parameters that are in the UpdateParameters collection.

(继承自 SqlDataSource)

事件

DataBinding

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

(继承自 Control)
Deleted

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

(继承自 SqlDataSource)
Deleting

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

(继承自 SqlDataSource)
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)
Filtering

执行筛选操作前发生。Occurs before a filter operation.

(继承自 SqlDataSource)
Init

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

(继承自 Control)
Inserted

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

(继承自 SqlDataSource)
Inserting

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

(继承自 SqlDataSource)
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 completed.

(继承自 SqlDataSource)
Selecting

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

(继承自 SqlDataSource)
Unload

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

(继承自 Control)
Updated

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

(继承自 SqlDataSource)
Updating

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

(继承自 SqlDataSource)

显式接口实现

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)
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)

扩展方法

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.

TryGetMetaTable(IDataSource, MetaTable)

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

适用于

另请参阅