Appendix: Creating the AdventureProducts.xsd DataSet

To create the AdventureProducts DataSet, we use the Visual Studio 2005 or Visual Web Developer 2005 Express wizards.

The AdventureWorks database must be in the application's App_Data folder. You can download the database from this URL:

http://msdn2.microsoft.com/en-us/library/ms124659.aspx

Creating the DataSet File

Start by selecting Add New Item... from the project's context menu in Solution Explorer. In the dialog that appears, select DataSet and name it AdventureProducts.xsd. Visual Studio asks you for your permission to create the App_Code directory if it doesn't already exist and to put the new DataSet file in it. Say yes to that.

Creating the Product Category Adapter

After a few seconds, a new wizard will appears and ask you for a connection. If you haven't already created a connection for the database, click the New Connection... button, choose Microsoft SQL Server Database File, and click Continue. In the next dialog, click the Browse... button and navigate to the location of the datafile. You can test the connection and check that it works before clicking OK.

You should now have a working connection stored in Web.config. Click Next. On the next screen, the wizard asks you to choose the access mode for the table adapter you're creating. Choose "Use SQL statements" and click Next.

Paste this SQL request in the query builder:

SELECT ProductCategoryID, Name FROM Production.ProductCategory ORDER BY Name

and click Next. On the next screen, ...

Get ASP.NET AJAX UpdatePanel Control now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.