XML to Dictionary through LINQ?
-
Hello, I'm trying make a dictionary pairing from 3 things in an XML file. The first item and key of the dictionary is a string, the value is a decimal which will be the result of a price element times a quantity element. Here is my LINQ query thus far... Dictionary<string, decimal> total = (from myfile in file.Descendants("invoice") let key = Convert.ToDecimal(myfile.Element("quanti… * Convert.ToDecimal(myfile.Element("price"… orderby Convert.ToDecimal(myfile.Element("quanti… * Convert.ToDecimal(myfile.Element("price"… select key).ToDictionary<string, decimal>(file.Element("partDesc").Value)… Can anyone help me? I have googled this over and over, and I have not been able to find anything that demonstrates anything close to what I'm trying to do. Thanks for any help!
-
Answer:
Look here http://stackoverflow.com/questions/1593235/linq-to-xml-dictionary-conversion Hope it helps
wmcgee35... at Yahoo! Answers Visit the source
Related Q & A:
- How to convert build.xml to maven pom.xml file?Best solution by Stack Overflow
- How to combine 3 tables using entity framework and LINQ?Best solution by Stack Overflow
- How to convert SQL query to LINQ query?Best solution by Stack Overflow
- How does the Left-Outer Join in Linq (C#) work?Best solution by devcurry.com
- how to on convert sql to linq?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.