Hello, i have a problem with my linq to xml query
var q = (from f in xmlLang.Element("lang").Elements("page")
where (string)f.Attribute("id") == "home"
select f.Element(LangElement).Value.ToString()).Take(1).SingleOrDefault();
The xml looks like this,
<lang>
<page id="home">
<hello>Hello!</hello>
</page>
...
</lang>
I get this error: Object reference not set to an instance of an object.
Thanks for your help :)