Using Access Data on an ASP.NET Web Page

06/21/2009

You can now use the database in a Web page. This part of the walkthrough uses an AccessDataSource control and a DataList control.

To add AccessDataSource and DataList controls to the page

  1. Open the Default.aspx page (or another page that you want to use) and switch to Design view.
  2. From the Data group in the toolbox, drag an AccessDataSource control onto the page.

    Note  If the Access Data Source Tasks menu does not appear, right-click the control and then click Show Smart Tag.

  3. On the Access Data Source Tasks shortcut menu, click Configure Data Source. The Configure Data Source wizard is displayed.
  4. On the Choose a database page, in the Microsoft Access Data file box, type ~/App_Data/Northwind.mdb or use the Browse button to select the .mdb file.
  5. Click Next to open the Configure Select Statement page, and then click Specify columns from a table or view.
  6. In the Name list, click Categories.
  7. Select the CategoryName and Description check boxes and then click Next.
  8. Optionally, click Test Query to test your query.
  9. Click Finish.
  10. From the Data group in the toolbox, drag a DataList control onto the page.
  11. On the DataList Tasks menu, in the Choose Data Source box, click AccessDataSource1.
  12. Click Ctrl+F5 to run the page with the default layout.
  13. Close the browser.
Posted in: Website-asp.net| Tags: asp.net Dynamic Data DataList Website Access Data Page Access database asp web accessdatasource

Hot Posts

Latest posts

Tags

Others

Sponsors