using (var stream = File.Open(filePath,FileMode.Open,FileAccess.Read)) using (XmlReader reader = XmlReader.Create(stream)) { while (reader.Read()) { // Only detect start elements. if (reader.IsStartElement()) { switch (reader.Name) { case "Component": fileElements.ComponentName = reader["Name"]; fileElements.DateRun = reader["DateRun"]; fileElements.Passed = reader["Passed"]; break; } } } if (filePath.ToLower().Contains("ebsserver")) { UpdateDataTable1(fileElements); } else if (filePath.ToLower().Contains("ebsui")) { UpdateDataTable2(fileElements); } else { UpdateDataTable3(fileElements); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)