- XML is case-sensitive, so you have to exactly match element name to make it work.
ROW
androw
are two different elements. Columns1
andColumn2
are elements, not attributes.- You have to use namespace for
Column0
/Column1
/Column2
as well. - Use explicit cast to
DateTime
/string
/int
instead ofValue
property +Parse
method calls. It's just better.
Update
Column2
containsdecimal
/double
value, notint
s:XNamespace ns = @"urn:schemas-microsoft-com:xml-analysis:rowset"; IEnumerable resultSet = (from result in xmlDoc.Root.Descendants(ns + "ROW") select new { Date = (DateTime)result.Element(ns + "Column0")), KPI = (string)result.Element(ns + "Column1")), Value = (decimal)result.Element(ns + "Column2")) });