I am reading a XMl and using it for some processing in my application.
var config = XElement.Load("c:/sample.xml");
Is there anyway to do load it in a better way? it takes a while while trying to process this line of code.
I am reading a XMl and using it for some processing in my application.
var config = XElement.Load("c:/sample.xml");
Is there anyway to do load it in a better way? it takes a while while trying to process this line of code.
Look at XmlReader
class, it provides fast, noncached, forward-only access to XML data.
You use so call DOM model of loading document which loads the whole XML. An alternative is a SAX model when you read data in consecutive manner. The API for that is XmlReader