EDN Admin
Well-known member
Why does the order by in this query not work?
<div style="background-color:white; color:black
<pre>XElement doc = XElement.Load(File);
<span style="color:blue var answers = <span style="color:blue from a <span style="color:blue in doc.Elements(<span style="color:#a31515 "Item")
<span style="color:blue where a.Attribute(<span style="color:#a31515 "level").Value.Equals(level)
<span style="color:blue orderby <span style="color:blue int.Parse(a.Element(<span style="color:#a31515 "Response").Attribute(<span style="color:#a31515 "Correct").Value) <span style="color:blue descending
<span style="color:blue select a;
<pre><?xml version=<span style="color:#a31515 "1.0" encoding=<span style="color:#a31515 "utf-8"?>
<Answers>
<Item level=<span style="color:#a31515 "1">
<Response Asked=<span style="color:#a31515 "30" Correct=<span style="color:#a31515 "23" DateTime=<span style="color:#a31515 "15-Dec-2010 10:43:18" Time=<span style="color:#a31515 "00:00:50.0230022" />
<Response Asked=<span style="color:#a31515 "30" Correct=<span style="color:#a31515 "28" DateTime=<span style="color:#a31515 "15-Dec-2010 10:43:18" Time=<span style="color:#a31515 "00:00:51.0791074" />
</Item>
</Answers>
[/code]
thanks for any help,
sivilian
View the full article
<div style="background-color:white; color:black
<pre>XElement doc = XElement.Load(File);
<span style="color:blue var answers = <span style="color:blue from a <span style="color:blue in doc.Elements(<span style="color:#a31515 "Item")
<span style="color:blue where a.Attribute(<span style="color:#a31515 "level").Value.Equals(level)
<span style="color:blue orderby <span style="color:blue int.Parse(a.Element(<span style="color:#a31515 "Response").Attribute(<span style="color:#a31515 "Correct").Value) <span style="color:blue descending
<span style="color:blue select a;
<pre><?xml version=<span style="color:#a31515 "1.0" encoding=<span style="color:#a31515 "utf-8"?>
<Answers>
<Item level=<span style="color:#a31515 "1">
<Response Asked=<span style="color:#a31515 "30" Correct=<span style="color:#a31515 "23" DateTime=<span style="color:#a31515 "15-Dec-2010 10:43:18" Time=<span style="color:#a31515 "00:00:50.0230022" />
<Response Asked=<span style="color:#a31515 "30" Correct=<span style="color:#a31515 "28" DateTime=<span style="color:#a31515 "15-Dec-2010 10:43:18" Time=<span style="color:#a31515 "00:00:51.0791074" />
</Item>
</Answers>
[/code]
thanks for any help,
sivilian
View the full article