XSD schemas play an important role in the .NET framework. This is especially true when DataSets are involved. This example shows how to load a schema into a DataSet using the ReadXmlSchema() method and demonstrates how schemas are used to supply data types for DataColumns.
After running the sample you will see the error message that results from attemping to insert incorrect data into a DateTime DataColumn. The schema specified the data type for the column. You will also be able to compare the ShippedDate field in the source XML document (click View Source to see it) to the value shown in the DataGrid. Because the data type for the ShippedDate DataColumn is known after the schema is loaded, the data is displayed in a DateTime format in the DataGrid.
|