XML,XSD and Dataset's with c#
-
I'm building an asp.net app with c# to load data from different file resources, validate it and push it into a SQL Server db. I've handled Word interop so I can pull in data from pre-defined Word documents, validate and load it. I've worked with CSV's and have no problem there. The issue I'm having is XML, or rather XSD. I have an XSD which I want to use to validate data imported from XML. I've tried the XSD.exe tool but it just doesn't seem to generate an accurate typed dataset, basically not all datatables I'd expect defined, are defined. Can I use an XSD file at runtime to validate XML imported using ReadXML, and if not, how else can I do this? Any thoughts appreciated, all avenues explored... Rhys "When one burns one's bridges, what a very nice fire it makes" -- Dylan Thomas "As to marriage or celibacy, let a man take the course he will. He will be sure to repent" -- Socrates "Doh!" -- Homer Simpson
-
I'm building an asp.net app with c# to load data from different file resources, validate it and push it into a SQL Server db. I've handled Word interop so I can pull in data from pre-defined Word documents, validate and load it. I've worked with CSV's and have no problem there. The issue I'm having is XML, or rather XSD. I have an XSD which I want to use to validate data imported from XML. I've tried the XSD.exe tool but it just doesn't seem to generate an accurate typed dataset, basically not all datatables I'd expect defined, are defined. Can I use an XSD file at runtime to validate XML imported using ReadXML, and if not, how else can I do this? Any thoughts appreciated, all avenues explored... Rhys "When one burns one's bridges, what a very nice fire it makes" -- Dylan Thomas "As to marriage or celibacy, let a man take the course he will. He will be sure to repent" -- Socrates "Doh!" -- Homer Simpson
try using the XMLValidatingReader