I trying to parse the “message” element out of the following XML fragment using Linq to XML but for some reason it isn’t working:
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code/>
<message xml:lang="en-US">Bad Request - Error in query syntax.</message>
</error>
I’m sure that I’m missing something stupid.
Well how does your code look, which is the result you expect, which one do you get, if you get an error post the exact error message. The fragment has a namespace so make sure when selecting elements you do something like this: