Export (0) Print
Expand All

AccessDataSource control

The AccessDataSource control enables you to retrieve data from a Microsoft Access database (.mdb file).

The most common way to use an AccessDataSource control is to specify it in the Data Source Configuration Wizard when you set the Data Source of a data-bound control such as the GridView control, FormView control, DetailsView control, DataList control, or Repeater control.

You can also add an AccessDataSource control to a page by dragging it from the Toolbox panel onto your page. When the control is on your page, right-click it and choose Properties to open the Tag Properties panel where you can set properties for the control.

Cc295475.alert_note(en-us,Expression.30).gifNote:

Many ASP.NET controls do not have a visual representation at run time. The control is always visible in Code view. If you do not see a representation of the control in Design view, on the View menu, point to Visual Aids and then click ASP.NET NonVisual Controls.

The AccessDataSource control inherits the SqlDataSource class and replaces the ConnectionString property with a DataFile property to make it more convenient to connect to a Microsoft Access database. The AccessDataSource control uses the System.Data.OleDb provider to connect to Access databases using the Microsoft.Jet.OLEDB.4.0 OLE DB provider.

The AccessDataSource control does not support connecting to Access databases that are protected by a user name or password, because you cannot set the ConnectionString property. 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.

For more information about using the AccessDataSource control, see AccessDataSource Class in the MSDN library.

Community Additions

ADD
Show:
© 2014 Microsoft