Home > Articles > Web Services > XML

  • Print
  • + Share This
From the author of

Visually Defining a Schema

You have the option of using controls in the Toolbox to define a new Schema, or drag and drop tables from the server explorer to infer a Schema from existing tables. We will use the latter approach and create an XML Schema from the Northwind database. The Schema in this example will describe the Orders, Order Details, and Product information tables.

To begin, you will need a connection to one of the example copies of the Northwind database. (You can search for NWIND.mdb or install a copy of MSDE—desktop SQL Server.)

Add the first element to the Schema Designer by expanding the SQL Server node in the Server Explorer, and drag and drop the Orders table onto the Schema Designer (shown in Figure 3). Select the topmost element, open the properties window, and modify the name property to OrderDetails (also shown in Figure 3). OrderDetails will be the class name of your typed DataSet.

Figure 3Figure 3 Visually define an XML Schema by dragging and dropping tables onto the Schema Designer, as shown.

At this juncture, you can click on the XML tab (refer to Figure 3) to familiarize yourself with the basic content of an XML Schema. If you are ambitious, you can create XML Schemas by writing the XML yourself. This seems like a lot of work.

  • + Share This
  • 🔖 Save To Your Account