i

ASP.Net A Complete Guide

The AccessDataSource Control

This control represents a connection to the Access database. It is based on the SqlDataSource control &it provides a programming interface. A primary characteristic of the AccessDataSource control is that we need not require setting the ConnectionString property. We need to just set the location of the Access (.mdb) file in the “DataFile” property, and the AccessDataSource will take care of the underlying connection to the database.

The following are the features of the AccessDataSource control.

  • Sorting – It will set a “DataSourceMode “property to the DataSet value.

  • Filtering - It will set a “FilterExpression” property to a filtering expression

  • Updating - It will set an “UpdateCommand” property to a SQL statement that will be used in updating the data.

  • Deleting - It will set a" DeleteCommand” property to a SQL statement used to delete data.

  • Inserting - It will set an “InsertCommand” property to a SQL statement used to insert data.

  • Caching - It will set a “DataSourceMode” property to the DataSet value, the “EnableCaching” property to true

Syntax with example: