"Ramakant" <ra********@yahoodontspam.com> wrote in message news:e1**************@TK2MSFTNGP14.phx.gbl...
hi i am new at this...whats the better way to read xml files..create a
dataset and read them using xml only for validation ...
or
use xmlreader to validate and read them?
Ramakant,
If you already have an ADO.NET DataSet, then it's more convenient
to use ADO.NET's support for XML. In many cases, the relational
qualities of a DataSet constrain what's acceptable in the way of an
XML document -- but if you're already there and have a mind to
apply ADO.NET style constraints to the DataSet in order to validate
it (due to similarity with your Data Model, for instance) then there's
not much reason to change.
OTOH, if you don't already have an ADO.NET DataSet it seldom
makes sense to shoehorn your XML into one. Developers often
experience difficulties for just this reason -- their XML is not really
relational but they try to push it into a DataSet and have problems.
When your XML isn't relational, using XmlValidatingReader or
XmlDocument (or XPathDocument if you're leaning to processing
the XML with XSLT) is advisable.
Derek Harmon