System.Web.UI.WebControls.SqlDataSource Members

The members of System.Web.UI.WebControls.SqlDataSource are listed below.

See Also: Inherited members from System.Web.UI.DataSourceControl

Public Constructors

Initializes a new instance of the System.Web.UI.WebControls.SqlDataSource class.

Initializes a new instance of the System.Web.UI.WebControls.SqlDataSource class with the specified connection string and Select command.

Initializes a new instance of the System.Web.UI.WebControls.SqlDataSource class with the specified connection string and Select command.

Public Properties

CacheDurationint.

Gets or sets the length of time, in seconds, that the data source control caches data that is retrieved by the SqlDataSource.Select(System.Web.UI.DataSourceSelectArguments) method.

CacheExpirationPolicySystem.Web.UI.DataSourceCacheExpiry.

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.

CacheKeyDependencystring.

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.

CancelSelectOnNullParameterbool.

Gets or sets a value indicating whether a data retrieval operation is canceled when any parameter that is contained in the SqlDataSource.SelectParameters collection evaluates to null.

ConflictDetectionSystem.Web.UI.ConflictOptions.

Gets or sets the value indicating how the System.Web.UI.WebControls.SqlDataSource control performs updates and deletes when data in a row in the underlying database changes during the time of the operation.

ConnectionStringstring.

Gets or sets the ADO.NET provider–specific connection string that the System.Web.UI.WebControls.SqlDataSource control uses to connect to an underlying database.

DataSourceModeSqlDataSourceMode.

Gets or sets the data retrieval mode that the System.Web.UI.WebControls.SqlDataSource control uses to fetch data.

DeleteCommandstring.

Gets or sets the SQL string that the System.Web.UI.WebControls.SqlDataSource control uses to delete data from the underlying database.

DeleteCommandTypeSqlDataSourceCommandType.

Gets or sets a value indicating whether the text in the SqlDataSource.DeleteCommand property is an SQL statement or the name of a stored procedure.

[read-only]
DeleteParametersParameterCollection.

Gets the parameters collection that contains the parameters that are used by the SqlDataSource.DeleteCommand property from the System.Web.UI.WebControls.SqlDataSourceView object that is associated with the System.Web.UI.WebControls.SqlDataSource control.

EnableCachingbool.

Gets or sets a value indicating whether the System.Web.UI.WebControls.SqlDataSource control has data caching enabled.

FilterExpressionstring.

Gets or sets a filtering expression that is applied when the SqlDataSource.Select(System.Web.UI.DataSourceSelectArguments) method is called.

[read-only]
FilterParametersParameterCollection.

Gets a collection of parameters that are associated with any parameter placeholders that are in the SqlDataSource.FilterExpression string.

InsertCommandstring.

Gets or sets the SQL string that the System.Web.UI.WebControls.SqlDataSource control uses to insert data into the underlying database.

InsertCommandTypeSqlDataSourceCommandType.

Gets or sets a value indicating whether the text in the SqlDataSource.InsertCommand property is an SQL statement or the name of a stored procedure.

[read-only]
InsertParametersParameterCollection.

Gets the parameters collection that contains the parameters that are used by the SqlDataSource.InsertCommand property from the System.Web.UI.WebControls.SqlDataSourceView object that is associated with the System.Web.UI.WebControls.SqlDataSource control.

OldValuesParameterFormatStringstring.

Gets or sets a format string to apply to the names of any parameters that are passed to the SqlDataSource.Delete or SqlDataSource.Update method.

ProviderNamestring.

Gets or sets the name of the .NET Framework data provider that the System.Web.UI.WebControls.SqlDataSource control uses to connect to an underlying data source.

SelectCommandstring.

Gets or sets the SQL string that the System.Web.UI.WebControls.SqlDataSource control uses to retrieve data from the underlying database.

SelectCommandTypeSqlDataSourceCommandType.

Gets or sets a value indicating whether the text in the SqlDataSource.SelectCommand property is an SQL query or the name of a stored procedure.

[read-only]
SelectParametersParameterCollection.

Gets the parameters collection that contains the parameters that are used by the SqlDataSource.SelectCommand property from the System.Web.UI.WebControls.SqlDataSourceView object that is associated with the System.Web.UI.WebControls.SqlDataSource control.

SortParameterNamestring.

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.

SqlCacheDependencystring.

Gets or sets a semicolon-delimited string that indicates which databases and tables to use for the Microsoft SQL Server cache dependency.

UpdateCommandstring.

Gets or sets the SQL string that the System.Web.UI.WebControls.SqlDataSource control uses to update data in the underlying database.

UpdateCommandTypeSqlDataSourceCommandType.

Gets or sets a value indicating whether the text in the SqlDataSource.UpdateCommand property is an SQL statement or the name of a stored procedure.

[read-only]
UpdateParametersParameterCollection.

Gets the parameters collection that contains the parameters that are used by the SqlDataSource.UpdateCommand property from the System.Web.UI.WebControls.SqlDataSourceView control that is associated with the System.Web.UI.WebControls.SqlDataSource control.

Public Methods

Delete() : int

Performs a delete operation using the SqlDataSource.DeleteCommand SQL string and any parameters that are in the SqlDataSource.DeleteParameters collection.

Insert() : int

Performs an insert operation using the SqlDataSource.InsertCommand SQL string and any parameters that are in the SqlDataSource.InsertParameters collection.

Select(System.Web.UI.DataSourceSelectArguments) : IEnumerable

Retrieves data from the underlying database by using the SqlDataSource.SelectCommand SQL string and any parameters that are in the SqlDataSource.SelectParameters collection.

Update() : int

Performs an update operation using the SqlDataSource.UpdateCommand SQL string and any parameters that are in the SqlDataSource.UpdateParameters collection.

Protected Methods

CreateDataSourceView(string) : SqlDataSourceView

Creates a data source view object that is associated with the data source control.

GetDbProviderFactory() : System.Data.Common.DbProviderFactory

Returns the System.Data.Common.DbProviderFactory object that is associated with the ADO.NET provider that is identified by the SqlDataSource.ProviderName property.

override
GetView(string) : System.Web.UI.DataSourceView

Gets the named data source view that is associated with the data source control.

override
GetViewNames() : ICollection

Gets a collection of names representing the list of view objects that are associated with the System.Web.UI.WebControls.SqlDataSource control.

override
LoadViewState(object)

Loads the state of the properties in the System.Web.UI.WebControls.SqlDataSource control that need to be persisted.

override
OnInit(EventArgs)

Adds a System.Web.UI.Page.LoadComplete event handler to the System.Web.UI.Page control that contains the System.Web.UI.WebControls.SqlDataSource control.

override
SaveViewState() : object

Saves the current view state of the System.Web.UI.WebControls.SqlDataSource control.

override
TrackViewState()

Tracks view state changes to the System.Web.UI.WebControls.SqlDataSource control so that the changes can be stored in the System.Web.UI.StateBag object for the control.

Public Events

Deleted

Occurs when a delete operation has completed.

Deleting

Occurs before a delete operation.

Filtering

Occurs before a filter operation.

Inserted

Occurs when an insert operation has completed.

Inserting

Occurs before an insert operation.

Selected

Occurs when a data retrieval operation has completed.

Selecting

Occurs before a data retrieval operation.

Updated

Occurs when an update operation has completed.

Updating

Occurs before an update operation.