System.Web 2.0.0.0 System.Web.UI.DataSourceControl System.ComponentModel.DefaultEvent("Selecting") System.ComponentModel.Designer("System.Web.UI.Design.WebControls.SqlDataSourceDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.ComponentModel.Design.IDesigner") System.ComponentModel.DefaultProperty("SelectQuery") System.Web.UI.PersistChildren(false) System.Web.UI.ParseChildren(true) In this topic: Introduction Data Connections Performing Data Operations Data Provider Caching Additional Features Data Source View Declarative Syntax

Introduction

The data source control represents data in an SQL relational database to data-bound controls. You can use the control in conjunction with a data-bound control to retrieve data from a relational database and to display, edit, and sort data on a Web page with little or no code.

Data Connections

To connect to a database, you must set the property to a valid connection string. The can support any SQL relational database that can be connected to using an ADO.NET provider, such as the SqlClient, OleDb, Odbc, or OracleClient provider. For information about how to secure connection strings, see
How To: Secure Connection Strings when Using Data Source Controls. To retrieve data from an underlying database, set the property with an SQL query. If the database that the is associated with supports stored procedures, you can set the property to the name of a stored procedure. The SQL query that you specify can also be a parameterized query. You can add objects that are associated with a parameterized query to the collection. For more information about parameterized SQL queries and their syntax, see Using Parameters with Data Source Controls. The control retrieves data whenever the method is called. This method provides programmatic access to the method that is specified by property. The method is automatically called by controls that are bound to the when their method is called. If you set the property of a data-bound control, the control automatically binds to data from the data source, as required. Setting the DataSourceID property is the recommended method for binding an control to a data-bound control. Alternatively, you can use the DataSource property, but then you must explicitly call the method of the data-bound control. Some examples of data-bound controls that can use are , , , and . You can call the method programmatically at any time to retrieve data from the underlying database. In declarative and programmatic ASP.NET scenarios, you can set the property of the data-bound control to the ID of the control. You can also assign an instance of the class to the property of the data-bound control. For more information about binding data-bound control to data source controls, see ASP.NET Data Access Overview.

Performing Data Operations

Depending on the capabilities of the underlying database product and the configuration of the instance of the class, you can perform data operations, such as updates, inserts, and deletes. To perform these data operations, set the appropriate command text and any associated parameters for the operation that you want to perform. For example, for an update operation, set the property to an SQL string or the name of a stored procedure and add any required parameters to the collection. The update is performed when the method is called, either explicitly by your code or automatically by a data-bound control. The same general pattern is followed for and operations. The SQL queries and commands that you use in the , , , and properties can be parameterized. This means that the query or command can use placeholders instead of literal values and bind the placeholders to application or user-defined variables. You can bind parameters in SQL queries to Session variables, values that are passed on the query string for a Web Forms page, the property values of other server controls, and more. For more information about how to use parameters in SQL queries with the , see
Using Parameters with Data Source Controls and Using Parameters with the SqlDataSource Control. By default, if one of the parameters is null when you execute a Select command, no data will be returned and no exception will be thrown. You can change this behavior by setting the property to false.

Data Provider

By default, the control works with the .NET Framework Data Provider for SQL Server, but is not Microsoft SQL Server–specific. You can connect the control with any database product for which there is a managed ADO.NET provider. When used with the provider, the can work with any OLE DB-compliant database. When used with the provider, the can be used with any ODBC driver and database, including IBM DB2, MySQL, and PostgreSQL. When used with the provider, the can work with Oracle 8.1.7 databases and later. The list of allowable providers is registered in the DbProviderFactories section of the configuration file, either in the Machine.config or Web.config file. For more information, see
Selecting Data using the SqlDataSource Control.

Caching

If you display data on your page using a control, you can increase the performance of the page by using the data caching capabilities of the data source control. Caching reduces the processing load on the database servers at the expense of memory on the Web server; in most cases, this is a good trade-off. The automatically caches data when the property is set to true and the property is set to the number of seconds that the cache stores data before the cache entry is discarded. You can also specify a and an optional value.

Additional Features

The provides additional capabilities, as listed in the following table. Capability Requirements Caching Set the property to the value, the property to true, and the and properties according to the caching behavior you want for your cached data. Deleting Set the property to an SQL statement used to delete data. This statement is typically parameterized. Filtering Set the property to the value. Set the property to a filtering expression used to filter the data when the method is called. Inserting Set the property to an SQL statement used to insert data. This statement is typically parameterized. Paging Not currently supported by the , however some data-bound controls, such as , support paging when you set the property to the value. Selecting Set the property to an SQL statement used to retrieve data. Sorting Set the property to . Updating Set the property to an SQL statement used to update data. This statement is typically parameterized.

Data Source View

As with all data source controls, the control is associated with a data source view class. The control has only one associated , and it is always named Table. There is no visual rendering of the control; it is implemented as a control so that you can create it declaratively and, optionally, to allow it to participate in state management. As a result, the does not support visual features, such as the ones that are provided by the or property.

Declarative Syntax

<asp:SqlDataSource     CacheDuration="string|Infinite"     CacheExpirationPolicy="Absolute|Sliding"     CacheKeyDependency="string"     CancelSelectOnNullParameter="True|False"     ConflictDetection="OverwriteChanges|CompareAllValues"     ConnectionString="string"     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"     ProviderName="string|System.Data.Odbc|System.Data.OleDb| System.Data.OracleClient|System.Data.SqlClient| Microsoft.SqlServerCe.Client"     runat="server"     SelectCommand="string"     SelectCommandType="Text|StoredProcedure"     SkinID="string"     SortParameterName="string"     SqlCacheDependency="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:SqlDataSource>
Represents an SQL database to data-bound controls.
Constructor To be added. Initializes a new instance of the class. 2.0.0.0 Constructor Because different database products use different varieties of SQL, the syntax for depends on the current ADO.NET provider being used, which is identified by the property. If the SQL string is a parameterized query or command, the placeholder of the parameter also depends on the ADO.NET provider being used. For example, if the provider is the , which is the default provider for the class, the placeholder of the parameter is '@parameterName'. However, if the provider is set to the or the , the placeholder of the parameter is '?'. For more information about parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control. The value can be an SQL string or the name of a stored procedure, if the data source supports stored procedures. Initializes a new instance of the class with the specified connection string and Select command. The connection string used to connect to the underlying database. The SQL query used to retrieve data from the underlying database. If the SQL query is a parameterized SQL string, you might need to add objects to the collection. 2.0.0.0 Constructor Because different database products use different varieties of SQL, the syntax of depends on the current ADO.NET provider being used, which is identified by the parameter. If the SQL string is a parameterized query or command, the placeholder of the parameter also depends on the ADO.NET provider being used. For example, if the provider is , which is the default provider for the class, the placeholder of the parameter is '@parameterName'. However, if the provider is set to the or the , the placeholder of the parameter is '?'. For more information about parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control. The property can be an SQL string or the name of a stored procedure, if the data source supports stored procedures. Initializes a new instance of the class with the specified connection string and Select command. The name of the data provider that the uses. If no provider is set, the uses the ADO.NET provider for Microsoft SQL Server, by default. The connection string used to connect to the underlying database. The SQL query used to retrieve data from the underlying database. If the SQL query is a parameterized SQL string, you might need to add objects to the collection. 2.0.0.0 Property System.ComponentModel.DefaultValue(0) System.Int32 To be added. The control supports data caching. While data is cached, the method retrieves data from the cache rather than from the underlying database. When the cache expires, the method retrieves data from the underlying database, and then caches the data again. The control automatically caches data when the property is set to true and the property is set to a value greater than 0, which indicates the number of seconds that the cache stores data before the cache entry is discarded. A value of 0 indicates an infinitely long cache. The behavior of the cache is determined by a combination of the duration and the property. If the property is set to the value, the caches data on the first data retrieval operation, holds it in memory for, at most, the amount of time that is specified by property. The data might be released before the duration time, if the memory is required. The cache is then refreshed during the next operation. If the property is set to the value, the data source control caches data on the first data retrieval operation, but resets the time window that it holds the cache for each subsequent operation. The cache expires, if there is no activity for a time that is equal to the value since the last operation. The control can cache data only when it is in mode. A exception is thrown by the method, if the control is set to the value and caching is also enabled. When you are using client impersonation under Microsoft Windows authentication, the data is cached when the first user accesses the data. If another user requests the same data, the data is retrieved from the cache. The data is not retrieved by making another call to the database to verify the user's access to the data. If you expect more than one user to access the data, and you want each retrieval to the data to be verified by the security configurations for the database, do not use caching. Gets or sets the length of time, in seconds, that the data source control caches data that is retrieved by the method. 2.0.0.0 Property System.ComponentModel.DefaultValue(System.Web.UI.DataSourceCacheExpiry.Absolute) System.Web.UI.DataSourceCacheExpiry To be added. The control supports data caching. While data is cached, the method retrieves data from the cache rather than from the underlying database. When the cache expires, the method retrieves data from the underlying database, and then caches the data again. The behavior of the cache is determined by a combination of the and settings. If the property is set to the value, the caches data on the first data retrieval operation, holds it in memory for the amount of time that is specified by the property, and then discards it after the time has lapsed. The cache is then refreshed during the next operation. If the property is set to the value, the data source control caches data on the first data retrieval operation, but resets the time window that it holds the cache for each subsequent operation. The cache expires, if there is no activity for a time that is equal to the value since the last operation. The control can cache data only when in the mode. A exception is thrown by the method, if the control is set to the value and caching is also enabled. When you are using client impersonation under Microsoft Windows authentication, the data is cached when the first user accesses the data. If another user requests the same data, the data is retrieved from the cache. The data is not retrieved by making another call to the database to verify the user's access to the data. If you expect more than one user to access the data, and you want each retrieval to the data to be verified by the security configurations for the database, do not use caching. 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. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.String To be added. The control supports data caching. While data is cached, the method retrieves data from the cache rather than from the underlying database. When the cache expires, the method retrieves data from the underlying database, and then caches the data again. You can set the property to create a dependency between all cache entries that are created by the control and the key. You can programmatically expire all the cache entries at any time by expiring the key. The control can cache data only when in the mode. A exception is thrown by the method, if the control is set to the value and caching is also enabled. A unique cache entry is created for every combination of the , , and properties. Multiple controls can use the same cache entries in scenarios where the controls load the same data from the same underlying database. When you are using client impersonation under Microsoft Windows authentication, the data is cached when the first user accesses the data. If another user requests the same data, the data is retrieved from the cache. The data is not retrieved by making another call to the database to verify the user's access to the data. If you expect more than one user to access the data, and you want each retrieval to the data to be verified by the security configurations for the database, do not use caching. 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. 2.0.0.0 Property System.ComponentModel.DefaultValue(true) System.Boolean To be added. The value of the property is stored in view state. Gets or sets a value indicating whether a data retrieval operation is canceled when any parameter that is contained in the collection evaluates to null. 2.0.0.0 Property System.ComponentModel.DefaultValue(System.Web.UI.ConflictOptions.OverwriteChanges) System.Web.UI.ConflictOptions To be added. The property determines whether parameters for old and new values are applied to the Update method. For example, if the command that is specified by the property returns a object with the columns Name and Number and the property is set to the value, parameters are created for Name and Number for the Update method. If the property is set to the value, parameters are created for Name, Number, original_Name, and original_Number. (The exact name of the parameters for the original values depends on the property.) The control then determines if the Update method that is specified in the property has parameters that match. Concurrency control is a technique that data stores use to control how data is read and changed in the store when multiple clients are accessing and manipulating the same data. For example, one client reads data and presents it to a user, while another client reads the same data, and presents it to a different user. If both users update the data and submit it to the data storage, some unexpected result might occur, because both clients might update different values for the same data. This is considered a conflict. By setting the property to the value, your Update method can then compare the old and new values to the original data source to detect conflicts and handle them, as necessary. The property delegates to the property of the object that is associated with the control. Gets or sets the value indicating how the control performs updates and deletes when data in a row in the underlying database changes during the time of the operation. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.ComponentModel.Editor("System.Web.UI.Design.WebControls.SqlDataSourceConnectionStringEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") System.String To be added. The control can be used with a variety of ADO.NET providers and the syntax of the connection string that is used to connect to an underlying data source is specific to the provider. When you configure a control, you set the property to the type of database (the default is ), and you set the property to a connection string that includes information that is required in order to connect to the database. The contents of a connection string differ depending on what type of database the data source control is accessing. For example, the control requires a server name, database (catalog) name, and information about how to authenticate the user when connecting to a SQL Server. For information about the contents of connection strings, see the property for the class, property for the class, property for the class, or the property for the class. If you change the property, the event is raised, causing any controls that are bound to the control to rebind. For information about storing a connection string, see How To: Secure Connection Strings when Using Data Source Controls. Gets or sets the ADO.NET provider–specific connection string that the control uses to connect to an underlying database. 2.0.0.0 Method System.Web.UI.WebControls.SqlDataSourceView Classes that derive from the class can override the method to return strongly typed data source view objects. Creates a data source view object that is associated with the data source control. A that is associated with the . The name of the data source view. 2.0.0.0 Property System.ComponentModel.DefaultValue(System.Web.UI.WebControls.SqlDataSourceMode.DataSet) System.Web.UI.WebControls.SqlDataSourceMode To be added. The data retrieval mode identifies how a control retrieves data from the underlying database. When the property is set to the value, data is loaded into a object and stored in memory on the server. This enables scenarios where user interface controls, such as , offer sorting, filtering, and paging capabilities. When the property is set to the value, data is retrieved by a object, which is a forward-only, read-only cursor. The specific type of the object depends on the NET data provider that the uses, which is identified by the property. By default, the control uses the provider for Microsoft SQL Server, the , and the data reader is a object. If you change the property, the event is raised, causing any controls that are bound to the to rebind. The value of the property is stored in view state. Gets or sets the data retrieval mode that the control uses to fetch data. 2.0.0.0 Method System.Int32 Before the delete operation is performed, the method is called to raise the event. You can handle this event to examine the values of the parameters and to perform any preprocessing before a delete operation. After the operation completes, the method is called to raise the event. You can handle this event to examine any return values and error codes and to perform any post-processing. The method is provided for programmatic access to the Delete method. If the control is associated with a data-bound control, the data-bound control automatically calls the Delete method. The method delegates to the method of the object that is associated with the control. To perform the operation, the builds a object using the text and any associated values, and then executes the against the underlying database. Performs a delete operation using the SQL string and any parameters that are in the collection. A value that represents the number of rows deleted from the underlying database. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.String To be added. The represents an SQL query or the name of a stored procedure, and is used by the method. Because different database products use different varieties of SQL, the syntax of the SQL string depends on the current ADO.NET provider being used, which is identified by the property. If the SQL string is a parameterized query or command, the syntax of the parameter also depends on the ADO.NET provider being used. For example, if the provider is the , which is the default provider for the class, the syntax of the parameter is '@parameterName'. However, if the provider is set to the or , the placeholder of the parameter is '?'. For more information about parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control. The property can be an SQL string or the name of a stored procedure, if the database supports stored procedures. The property delegates to the property of the object that is associated with the control. For security purposes, the property is not stored in view state. Because it is possible to decode the contents of view state on the client, storing sensitive information about the database structure in view state could result in an information disclosure vulnerability. Gets or sets the SQL string that the control uses to delete data from the underlying database. 2.0.0.0 Property System.ComponentModel.DefaultValue(System.Web.UI.WebControls.SqlDataSourceCommandType.Text) System.Web.UI.WebControls.SqlDataSourceCommandType To be added. The property delegates to the property of the object that is associated with the control. Gets or sets a value indicating whether the text in the property is an SQL statement or the name of a stored procedure. 2.0.0.0 Event System.Web.UI.WebControls.SqlDataSourceStatusEventHandler Handle the event to examine the values of output parameters after a delete operation has completed. The output parameters are available from the object that is associated with the event. For more information about handling events, see Consuming Events. Occurs when a delete operation has completed. 2.0.0.0 Property System.ComponentModel.DefaultValue(null) System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty) System.ComponentModel.MergableProperty(false) System.ComponentModel.Editor("System.Web.UI.Design.WebControls.ParameterCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") System.Web.UI.WebControls.ParameterCollection To be added. If the property contains a parameterized SQL query, the collection contains any objects that correspond to the parameter placeholders in the SQL string. Make sure that no controls in the data-bound control that you bind to the control have names that match any parameter names in the collection. Parameters that have the same name as bound fields are excluded from the SQL command, and a "parameter was not supplied" error might result. If the property is set to the value, the parameters are created for both the old and new values of the data. The parameters for the old values are named according to the property. Depending on the ADO.NET provider, the order of the parameters in the collection might be important. The and providers associate the parameters in the collection according to the order in which the parameters appear in the parameterized SQL query. The provider, which is the default ADO.NET provider for the control, associates the parameters in the collection by matching the name of the parameter with the placeholder in the SQL query. For more information about parameterized SQL queries and commands, see Using the SqlDataSource and AccessDataSource Controls with Parameters. The property retrieves the property that is contained by the object that is associated with the control. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Gets the parameters collection that contains the parameters that are used by the property from the object that is associated with the control. 2.0.0.0 Event System.Web.UI.WebControls.SqlDataSourceCommandEventHandler Handle the event to perform additional initialization operations that are specific to your application, to validate the values of parameters, or to change the parameter values before the control performs the delete operation. The connection to the underlying data source is not yet open when the event handler delegate is called. Therefore, you cannot cancel the operation directly by calling the method on the object that is exposed by the object. You can, however, cancel the database operation by setting the property of the object to true. For more information about handling events, see Consuming Events. Occurs before a delete operation. 2.0.0.0 Property System.ComponentModel.DefaultValue(false) System.Boolean To be added. The control supports data caching. While data is cached, the method retrieves data from the cache rather than from the underlying database. When the cache expires, the method retrieves data from the underlying database, and then caches the data again. The control automatically caches data when the property is set to true and the property is set to a value greater than 0, which indicates the number of seconds that the cache stores data before retrieving a fresh set. When you are using client impersonation under Microsoft Windows authentication, the data is cached when the first user accesses the data. If another user requests the same data, the data is retrieved from the cache. The data is not retrieved by making another call to the database to verify the user's access to the data. If you expect more than one user to access the data, and you want each retrieval to the data to be verified by the security configurations for the database, do not use caching. Gets or sets a value indicating whether the control has data caching enabled. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.String To be added. The property value is a format string expression (a string that is processed by the method) that uses the values in the collection for any substitution parameters included in the string. The filter expression syntax is the same syntax that is accepted by the property, because the filter expression is applied to the property of the object that is returned from executing the method. For more information, see . If you add parameters to the collection, you can also include format string placeholders (for example, "{0}") in the expression to substitute for parameter values. The placeholders are replaced according to the index of the parameter in the collection. If an object in the collection is null, the object will be replaced by an empty string. You can include parameters in the property. If the parameter is a string or character type, enclose the parameter in single quotation marks. Quotation marks are not required, if the parameter is a numeric type. The collection contains the parameters that are evaluated for the placeholders that are found in the property. The control supports filtering data only when in the mode. The property delegates to the property of the object that is associated with the control. Gets or sets a filtering expression that is applied when the method is called. 2.0.0.0 Event System.Web.UI.WebControls.SqlDataSourceFilteringEventHandler Handle the event to perform validation operations on filter parameter values before the control performs a filter operation. You can cancel the method by setting the property of the object to true. The event is raised only if the property is set. The event delegates to the event of the object that is associated with the control. For more information about handling events, see Consuming Events. Occurs before a filter operation. 2.0.0.0 Property System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty) System.ComponentModel.MergableProperty(false) System.ComponentModel.Editor("System.Web.UI.Design.WebControls.ParameterCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") System.ComponentModel.DefaultValue(null) System.Web.UI.WebControls.ParameterCollection To be added. The parameters in the collection are associated with any parameters that are specified in the property. The parameter placeholders that are specified in the property are matched by order to parameter objects in the collection when the method is called. The property retrieves the property that is contained by the object that is associated with the control. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Gets a collection of parameters that are associated with any parameter placeholders that are in the string. 2.0.0.0 Method System.Data.Common.DbProviderFactory The property is used by the control to create the correct ADO.NET connection, command, and parameter objects when interacting with a database. Returns the object that is associated with the ADO.NET provider that is identified by the property. A that represents the identified ADO.NET provider; otherwise, and instance of the , if no provider is set. 2.0.0.0 Method System.Web.UI.DataSourceView The control supports only one data source view. As with all data source view objects, the object that is associated with the data source control defines its capabilities, performs all work that is necessary to retrieve data from the underlying database, and performs operations, such as sorting, inserting, deleting, and updating. Gets the named data source view that is associated with the data source control. The named "Table" that is associated with the . The name of the view to retrieve. Because the supports only one view, is ignored. 2.0.0.0 Method System.Collections.ICollection The control supports only one view on its underlying data, named "Table". The method returns a single-element collection of this one view name. Gets a collection of names representing the list of view objects that are associated with the control. An that contains the names of the views associated with the . 2.0.0.0 Method System.Int32 Before the insert operation is performed, the method is called to raise the event. You can handle this event to examine the values of the parameters and to perform any preprocessing before the operation. To perform an insert operation, the object builds an object using the text and any associated properties, and then executes the object against the underlying database. After the operation completes, the method is called to raise the event. You can handle this event to examine any return values and error codes and to perform any post-processing. The method is provided for programmatic access to the Insert method. If the control is associated with a data-bound control, the data-bound control automatically calls the Insert method. The method delegates to the method of the object that is associated with the control. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Performs an insert operation using the SQL string and any parameters that are in the collection. A value that represents the number of rows inserted into the underlying database. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.String To be added. The represents either an SQL query or the name of a stored procedure, and is used by the method. Because different database products use different varieties of SQL, the syntax of the SQL string depends on the current ADO.NET provider being used, which is identified by the property. If the SQL string is a parameterized query or command, the placeholder of the parameter also depends on the ADO.NET provider being used. For example, if the provider is the , which is the default provider for the class, the placeholder of the parameter is '@parameterName'. However, if the provider is set to the or , the placeholder of the parameter is '?'. For more information about parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control. The can be an SQL string or the name of a stored procedure, if the data source supports stored procedures. This property delegates to the property of the that is associated with the control. For security purposes, the property is not stored is view state. Because it is possible to decode the contents of view state on the client, storing sensitive information about the database structure in view state could result in an information disclosure vulnerability. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Gets or sets the SQL string that the control uses to insert data into the underlying database. 2.0.0.0 Property System.ComponentModel.DefaultValue(System.Web.UI.WebControls.SqlDataSourceCommandType.Text) System.Web.UI.WebControls.SqlDataSourceCommandType To be added. The property delegates to the property of the object that is associated with the control. Gets or sets a value indicating whether the text in the property is an SQL statement or the name of a stored procedure. 2.0.0.0 Event System.Web.UI.WebControls.SqlDataSourceStatusEventHandler Handle the event to examine the values of output parameters after an insert operation has completed. The output parameters are available from the object that is associated with the event. For more information about handling events, see Consuming Events. Occurs when an insert operation has completed. 2.0.0.0 Event System.Web.UI.WebControls.SqlDataSourceCommandEventHandler Handle the event to perform additional initialization operations that are specific to your application, to validate the values of parameters, or to change the parameter values before the control performs the insert operation. The connection to the underlying data source is not yet open when the event handler delegate is called. Therefore, you cannot cancel the operation directly by calling the method on the object that is exposed by the property. You can, however, cancel the database operation by setting the property of the object to true. For more information about handling events, see Consuming Events. Occurs before an insert operation. 2.0.0.0 Property System.ComponentModel.Editor("System.Web.UI.Design.WebControls.ParameterCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") System.ComponentModel.MergableProperty(false) System.ComponentModel.DefaultValue(null) System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty) System.Web.UI.WebControls.ParameterCollection To be added. The property retrieves the property that is contained by the object that is associated with the control. If the property contains a parameterized SQL query, the collection contains any objects that correspond to the parameter placeholders in the SQL string. Depending on the ADO.NET provider, the order of the parameters in the collection might be important. The and providers associate the parameters in the collection according to the order that the parameters appear in the parameterized SQL query. The provider, which is the default ADO.NET provider for the control, associates the parameters in the collection by matching the name of the parameter with a placeholder alias in the SQL query. For more information about parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Gets the parameters collection that contains the parameters that are used by the property from the object that is associated with the control. 2.0.0.0 Method System.Void The method is used to load the previously saved view state of the control. Loads the state of the properties in the control that need to be persisted. An object that represents the state of the . 2.0.0.0 Property System.ComponentModel.DefaultValue("{0}") System.String To be added. The format string is applied only to primary keys, such as those that are identified by the DataKeyNames property of the associated data-bound control, or in delete and update scenarios where the property is set to the value and a set of are passed to the corresponding data method. In this case, the format string is applied to each parameter name in the collection. Two common scenarios where you might change the property are as follows: To differentiate between old and new values in updates. When the property is set to the value, parameters for both the original and new values are added to the collection. Without the formatting string, two parameters with the same name would be created for each data field. By changing the name of the original value parameter, you can compare the data to the original data source to detect conflicts and compare key values. Some visual designers implement a particular naming scheme for original values and keys. Gets or sets a format string to apply to the names of any parameters that are passed to the or method. 2.0.0.0 Method 2.0.0.0 System.Void The event handler that is added by the object updates the and values. If the values are updated, the event is raised, causing any controls that are bound to the control to rebind. Adds a event handler to the control that contains the control. An that contains the event data. Property System.ComponentModel.TypeConverter("System.Web.UI.Design.WebControls.DataProviderNameConverter, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") System.ComponentModel.DefaultValue("") System.String To be added. The .NET Framework includes the following data providers: The provider is the default .NET Framework Data Provider for SQL Server. The provider is the .NET Framework Data Provider for OLE DB. The provider is the .NET Framework Data Provider for ODBC. The provider is the .NET Framework Data Provider for Oracle. The property is never set to the name of an unmanaged ADO.NET provider, such as MSDAORA. For more information, see Selecting Data using the SqlDataSource Control. If you change the property, the event is raised, causing any controls that are bound to the to rebind. A list of available providers is specified in the DbProviderFactories subsection of the system.data section of the Machine.config file. Gets or sets the name of the .NET Framework data provider that the control uses to connect to an underlying data source. 2.0.0.0 Method System.Object To be added. Saves the current view state of the control. An object that contains the saved state of the . 2.0.0.0 Method System.Collections.IEnumerable To be added. The method is automatically called during the phase of the page life cycle. It is called by data-bound controls that have been attached to a control through their property. The method returns a object if the property is set to the value. The method returns a object if the property is set to the value. Close the object when you have finished reading the data. Before the operation is performed, the method is called to raise the event. You can handle this event to examine the values of the parameters and to perform any processing before the operation. After the operation completes, the method is called to raise the event. You can handle this event to examine any return values and error codes and to perform any post-processing. If the property is set to and caching is enabled, the object retrieves data from and saves data to the cache during the operation. The cache is created, discarded, or refreshed based on the caching behavior that is specified by the combination of the and properties. When you are using client impersonation under Microsoft Windows authentication, the data is cached when the first user accesses the data. If another user requests the same data, the data is retrieved from the cache. The data is not retrieved by making another call to the database to verify the user's access to the data. If you expect more than one user to access the data, and you want each retrieval of data to be verified by the security configurations for the database, do not use caching. If the property is set to and a property has been specified, the filter expression is evaluated with any supplied properties and the resulting filter is applied to the list of data during the operation. The method delegates to the method of the object that is associated with the control. To perform a data retrieval operation, the builds a object by using the text and any associated values, and then executes the against the underlying database. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Retrieves data from the underlying database by using the SQL string and any parameters that are in the collection. An list of data rows. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.String To be added. The property represents an SQL query or the name of a stored procedure, and is used by the method to retrieve data from a SQL Server database. If you use an asterisk (*) in the Select command to select all columns, and if you use automatic code generation to perform update or delete operations, make sure that no columns have spaces in their names. Because different database products use different varieties of SQL, the syntax of the SQL string depends on the current ADO.NET provider being used, which is identified by the property. If the SQL string is a parameterized query or command, the placeholder of the parameter also depends on the ADO.NET provider being used. For example, if the provider is the , which is the default provider for the class, the placeholder of the parameter is '@parameterName'. However, if the provider is set to the or , the placeholder of the parameter is '?'. For more information about parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control. The property can be an SQL string or the name of a stored procedure, if the data source supports stored procedures. The property delegates to the property of the object that is associated with the control. For security purposes, the property is not stored is view state. Because it is possible to decode the contents of view state on the client, storing sensitive information about the database structure in view state could result in an information disclosure vulnerability. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Gets or sets the SQL string that the control uses to retrieve data from the underlying database. 2.0.0.0 Property System.ComponentModel.DefaultValue(System.Web.UI.WebControls.SqlDataSourceCommandType.Text) System.Web.UI.WebControls.SqlDataSourceCommandType To be added. The property delegates to the property of the object that is associated with the control. Gets or sets a value indicating whether the text in the property is an SQL query or the name of a stored procedure. 2.0.0.0 Event System.Web.UI.WebControls.SqlDataSourceStatusEventHandler Handle the event to examine the values of output parameters after a data retrieval operation has completed. The output parameters are available from the object that is associated with the event. For more information about handling events, see Consuming Events. Occurs when a data retrieval operation has completed. 2.0.0.0 Event System.Web.UI.WebControls.SqlDataSourceSelectingEventHandler Handle the event to perform additional initialization operations that are specific to your application, to validate the values of parameters, or to change the parameter values before the control performs the select operation. The select arguments are available from the object that is associated with the event. For more information about handling events, see Consuming Events. Occurs before a data retrieval operation. 2.0.0.0 Property System.ComponentModel.Editor("System.Web.UI.Design.WebControls.ParameterCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") System.ComponentModel.MergableProperty(false) System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty) System.ComponentModel.DefaultValue(null) System.Web.UI.WebControls.ParameterCollection To be added. If the property contains a parameterized SQL query, the collection contains any objects that correspond to the parameter placeholders in the SQL string. Depending on the ADO.NET provider, the order of the parameters in the collection might be important. The and providers associate the parameters in the collection according to the order that the parameters appear in the parameterized SQL query. The provider, which is the default ADO.NET provider for the control, associates the parameters in the collection by matching the name of the parameter with a placeholder alias in the SQL query. For more information about parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control. The property retrieves the property that is contained by the object that is associated with the control. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Gets the parameters collection that contains the parameters that are used by the property from the object that is associated with the control. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.String To be added. The property is evaluated only when the SQL command that is contained by the property is the name of a stored procedure. In this case, if the property is set, it contains the name of a parameter that is used to sort the results of the stored procedure. If the property is set, it is prepended to the property. 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. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.String To be added. The control supports an optional expiration policy based on the object for the data cache (the service must be configured for the database server). The string identifies databases and tables according to the same format that is used by the @ Page directive, where the first part of the string is a connection string to a Microsoft SQL Server database, followed by a colon delimiter, and finally the name of the database table (for example, "connectionstring1:table1"). If the property depends on more than one table, the connection string-and-table name pairs are separated by semicolons (for example, "connectionstring1:table1";connectionstring2:table2"). When you are using client impersonation under Microsoft Windows authentication, the data is cached when the first user accesses the data. If another user requests the same data, the data is retrieved from the cache. The data is not retrieved by making another call to the database to verify the user's access to the data. If you expect more than one user to access the data, and you want each retrieval to the data to be verified by the security configurations for the database, do not use caching. Gets or sets a semicolon-delimited string that indicates which databases and tables to use for the Microsoft SQL Server cache dependency. 2.0.0.0 Method System.Void The method is overridden to mark the starting point to begin tracking and saving changes to the control as part of the view state for the control. Tracks view state changes to the control so that the changes can be stored in the object for the control. 2.0.0.0 Method System.Int32 The method is automatically called by the , , and controls during postback if the data has been changed. For data that has been changed in other controls, the method can be explicitly called on postback during the event. Before the operation is performed, the method is called to raise the event. You can handle this event to examine the values of the parameters and to perform any preprocessing before an operation. After the operation completes, the method is called to raise the event. You can handle this event to examine any return values and error codes and to perform any post-processing. The method delegates to the method of the object that is associated with the control. To perform an update operation, the builds a object using the text and any associated properties, and then executes the object against the underlying database. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Performs an update operation using the SQL string and any parameters that are in the collection. A value that represents the number of rows updated in the underlying database. 2.0.0.0 Property System.ComponentModel.DefaultValue("") System.String To be added. The represents an SQL query or the name of a stored procedure, and is used by the method. Because different database products use different varieties of SQL, the syntax of the SQL string depends on the current ADO.NET provider being used, which is identified by the property. If the SQL string is a parameterized query or command, the placeholder of the parameter also depends on the ADO.NET provider being used. For example, if the provider is the , which is the default provider for the class, the placeholder of the parameter is '@parameterName'. However, if the provider is set to the or , the placeholder of the parameter is '?'. For more information about parameterized SQL queries and commands, see Using Parameters with the SqlDataSource Control. The property can be an SQL string or the name of a stored procedure, if the data source supports stored procedures. The property delegates to the property of the object that is associated with the control. For security purposes, the property is not stored is view state. Because it is possible to decode the contents of view state on the client, storing sensitive information about the database structure in view state could result in an information disclosure vulnerability. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Gets or sets the SQL string that the control uses to update data in the underlying database. 2.0.0.0 Property System.ComponentModel.DefaultValue(System.Web.UI.WebControls.SqlDataSourceCommandType.Text) System.Web.UI.WebControls.SqlDataSourceCommandType To be added. The property delegates to the property of the object that is associated with the control. Gets or sets a value indicating whether the text in the property is an SQL statement or the name of a stored procedure. 2.0.0.0 Event System.Web.UI.WebControls.SqlDataSourceStatusEventHandler Handle the event to examine the values of output parameters after an update operation has completed. The output parameters are available from the object that is associated with the event. For more information about handling events, see Consuming Events. Occurs when an update operation has completed. 2.0.0.0 Property System.ComponentModel.DefaultValue(null) System.ComponentModel.MergableProperty(false) System.ComponentModel.Editor("System.Web.UI.Design.WebControls.ParameterCollectionEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty) System.Web.UI.WebControls.ParameterCollection To be added. If the property contains a parameterized SQL query, the collection contains any objects that correspond to the parameter placeholders in the SQL string. Parameter names might be affected by the property, specifically if the name identifies a primary key, such as a key specified using the DataKeyNames property of the data-bound control, or in delete and update scenarios where the property is set to the value and a set of are passed to the corresponding data method. In this case, the format string is applied to each parameter name in the collection. The order of the parameters in the collection might be important, depending on the ADO.NET provider. The and providers associate the parameters in the collection according to the order that the parameters appear in the parameterized SQL query. The provider, which is the default ADO.NET provider for the control, associates the parameters in the collection by matching the name of the parameter with a placeholder alias in the SQL query. For more information about parameterized SQL queries and commands, see Using the SqlDataSource and AccessDataSource Controls with Parameters. The property retrieves the property that is contained by the object that is associated with the control. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Gets the parameters collection that contains the parameters that are used by the property from the control that is associated with the control. 2.0.0.0 Event System.Web.UI.WebControls.SqlDataSourceCommandEventHandler Handle the event to perform additional initialization operations that are specific to your application, to validate the values of parameters, or to change the parameter values before the control performs the update operation. The connection to the underlying data source is not yet open when the event handler delegate is called. Therefore, you cannot directly cancel the database operation by calling the method on the object that is exposed by the object. You can, however, cancel the database operation by setting the property of the to true. For more information about handling events, see Consuming Events. Values are inserted into parameters without validation, which is a potential security threat. Use the event to validate parameter values before executing the query. For more information, see Script Exploits Overview. Occurs before an update operation. 2.0.0.0