A DataSet is derived from an XML schema. An XML schema can:
- Describe 'shape' of the DataSet. In other words, it tells if the data is related or hierarchical.
- Validate the data being imported.
- Establish the relational structure of database tables.
Let's create a sample DataSet with the XML designer. We will assume that we are creating a DataSet for a new table called MyTable:
- Open a windows project.
- Select Add New Item from File menu.
- Select a DataSet and give it some name and then click open.
- Select the XML tools tab and drag an element on the designer.
- In place of 'Element1' type the name of the table (MyTable).
- Go to the next row in the element. Click the dropdown in the 1st column and select 'Attribute'.
- In the second column type the name of the attribute and select attribute type from the third column.
- You can add all the columns you need. You can also drag 'Key' from the toolbox and define a key for your table.
- Save the schema.
- Now, if you want another table, just follow the same steps over.