score:3
Accepted answer
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"))
});
score:0
returnvalue = (from rows in doc.root.descendants(ns + "row")
select (from columns in rows.elements() select object)columns.value).toarray()
).tolist();
Source: stackoverflow.com
Related Query
- Fetching an XML using LINQ
- Empty namespace using Linq Xml
- Reading XML using XDocument & Linq - check if element is NULL?
- Update XML with C# using Linq
- How to get elements by name in XML using LINQ
- add data to existing xml file using linq
- C# check an element exists while using LINQ to XML
- How to properly search xml document using LINQ C#
- read xml file using linq
- how to add/insert conditional node into XML using linq to XML
- Compare two xml and print the difference using LINQ
- Generate xml using LINQ to XML
- Extract data from a XML string using linq vs xmlDocument
- how to compare 2 XML using LINQ in C#
- How to read XML file using System.IO.Stream with LINQ
- Parsing of XML string (with namespace) using LINQ
- Get max attribute value from XML using LINQ
- How to check if XML contains element when using LINQ to XML?
- Keep HTML tags in XML using LINQ to XML
- Delete multiple XML nodes in C# using Linq
- How do I read/write an Encrypted XML file using LINQ to XML?
- reading an XML string using LINQ
- Linq To XML - Using XDocument and creating list of objects
- Using LINQ to parse XML into Dictionary
- How do I clone a xml element using Linq to Xml
- get key value pairs from xml using linq
- Selecting elements from XML file using LINQ
- Select more then one node from XML using LINQ
- Querying xml child elements with prefixed namespace using LINQ to XML
- Getting all text nodes in xml using linq or xpath
More Query from same tag
- List where Clause with Remove
- How to display grandparent when child is given
- TableServiceContext and dynamic query
- Implement searching in a generic repository with Linq Expressions
- Using LINQ to combine the results of 2 queries
- How do you override lazy loading on a single LINQ query using Fluent NHibernate
- C# find JSON value based only on Key name through multiple levels of array
- SQL to LINQ with Case .. When in Order By
- Find difference from IList<string[]> one and IList<string[]> two using Linq operation
- Parsing JSON using LINQ
- Check for any element that exists in two collections
- Set Attribute value in LINQ to XML
- Linq Get Latest Date Query
- Fluent API and building a 1:* relationship
- Linq and SQL query comparison
- comparing two list of strings in C#
- How to use CollectionAssert (and Linq?) to find all the values for one property, are the same?
- DataTable joins c# - joins on datatable
- Using MIN function in LINQ
- LINQ lambda - convert int to string
- Convert a list linq expression to Defined list Class
- SQL related , Get latest related record
- Querying Two data tables asp.net
- Why would you use an immutable value in a dictionary?
- Task fired again after WaitAll
- LINQ - 'Could not translate expression' with previously used and proven query condition
- How can I query UTC-dates for the client's current day?
- LINQ - Local sequence cannot be used in LINQ to SQL implementations of query operators except the Contains operator
- Wrong select query generated with Entity Framework (mysterious extra column)
- Select from array only the best items