Visual Studio tries to create a strongly typed Data Set out of the XSD file.
The illustration validates an XML document that the user chooses, either or catelog1against the XML Schema document
You need one schema and two XML files to validate against the schema.
Failure to register a method with Validation Event Handler causes an exception (Xml Exception) to be thrown when the XML document is found to be invalid or missing.
After setting the Validation Type property, the Schema's property and Validation Event Handler of the Xml Reader Settings object, we are ready to create a validating Xml Reader.
If the XSD is publicly available using HTTP and referenced through a "schema Location" or "no Namespace Schema Location", then the validator will pick it up and it doesn't need to be specified/uploaded.
*The maximum size limit for file upload is 2 megabytes.I think there is a way to stop this happening by altering the file produced by xsd.exe, but there are 2 other ways. For this I have chosen to use a programmatical approach, which is as follows: This is easily achieved using some test code. I don’t know about you lot but I work with XML files a bit, but I don’t have to mess around with XSD (xml schema) files that often. And it seems like every time I do I forget what I did last time. Set the Xml Reader Settings object's Validation Type property to the value Validation Type.