[Solved] C# how xmlreader read attributes element value

With huge xml files I use combination of XML Reader and XML Linq using System; using System.Linq; using System.Text; using System.Collections; using System.Collections.Generic; using System.Xml; using System.Xml.Linq; namespace ConsoleApp2 { class Program { const string FILENAME = @”c:\temp\test.xml”; static void Main(string[] args) { XmlReader reader = XmlReader.Create(FILENAME); while(!reader.EOF) { if (reader.Name != “Subject”) { reader.ReadToFollowing(“Subject”); … Read more

[Solved] What is the fastest way to go through a XML file in C#?

Here is the example, which reads sample XML and shows comparison between Linq/XMlReader and XmlDocument Linq is fastest. Sample Code using System; using System.Diagnostics; using System.Linq; using System.Xml; using System.Xml.Linq; namespace ReadXMLInCsharp { class Program { static void Main(string[] args) { //returns url of main directory which contains “/bin/Debug” var url=System.IO.Path.GetDirectoryName( System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase); //correction in path … Read more