0% found this document useful (0 votes)
60 views

ASPNET Data Access Tutorial

This tutorial provides instructions for creating a web page that displays an editable GridView control connected to a Microsoft Access database table. The steps include adding a GridView to an ASPX page, importing an Access database, configuring the GridView as a data source, selecting fields to display, enabling sorting, editing and updating records, and additional formatting and functionality options.

Uploaded by

mothi1985
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

ASPNET Data Access Tutorial

This tutorial provides instructions for creating a web page that displays an editable GridView control connected to a Microsoft Access database table. The steps include adding a GridView to an ASPX page, importing an Access database, configuring the GridView as a data source, selecting fields to display, enabling sorting, editing and updating records, and additional formatting and functionality options.

Uploaded by

mothi1985
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

ASP.

NET & Data Access An Expression Web Tutorial


This tutorial will step you through creating a web site page that displays an editable GridView of an Access database table. It was taken from Chapter 37 of Jim Cheshires book Using Microsoft Expression Web 2. (At the end of that chapter is another tutorial that creates a master/detail page that first displays a GridView. Then, when you click on a product, it displays a detail view of all the fields for that particular record.) 1. 2. 3. 4. Create a new web site. File New Web Site General Empty Web Site Then create a new ASP.NET page. File New Page General ASPX Save the page as: gridview.aspx Drag a GridView control onto the page from the Data section of the ASP.NET Controls tab of the Toolbox. (You can also just double-click the control.) 5. Import the Nwind.mdb Access database file into the web site. File Import File Add File Then, select the Nwind.mdb file. 6. Click on the GridView Tasks pop-up (arrow on the GridView control you just inserted) 7. Select <New Data Source> from Choose Data Source 8. Select: Access Database Ok 9. Browse and choose Nwind.mdb Open Next 10. Select Employees table from the Name dropdown list. 11. Check the box on fields to be displayed in the grid. Then, Next Finish 12. TEST (<Ctrl+S> to save the page and then press the <F12> key to preview) 13. Go back to the GridView Tasks pop-up Configure DataSource Next Order by Sort by Last Name Then by First Name OK Next Finish 14. TEST 15. Go back to the GridView Tasks pop-up Click on the Enable Sorting checkbox 16. TEST. Click on the column titles to sort the rows by that field. 17. Go back to the GridView Tasks pop-up Configure Data Source Next Advanced button Click on the Generate INSERT, UPDATE, & DELETE checkbox OK Next Finish 18. Click on the Enable Editing checkbox. 19. TEST Try editing a row. Other things to try and make the page better: Choose one of the Auto Format options on the Grid View Tasks pop-up panel. Try some additional HTML/CSS formatting. DetailView or FormView control to see/edit/enter whole records. Enable/disable paging. Set the page length. See: http://msdn.microsoft.com/en-us/library/445z2s49.aspx for a discussion about using Access databases in web sites.

C:\Documents and Settings\All Users\Documents\ASPNET Data Access Tutorial.doc 5/30/2008

You might also like