-
July 8th, 2009, 09:22 AM
#1
linq to xml returns no results
on this xml :
<MYDB>
<Database>
<ConnectionString>MyConnectionString</ConnectionString>
</Database>
<Mapping>
<Map LocationInFile="0" dbColumn="Hello1"></Map>
<Map LocationInFile="1" dbColumn="Hello2"></Map>
<Map LocationInFile="2" dbColumn="Hello3"></Map>
<Map LocationInFile="3" dbColumn="Hello4"></Map>
</Mapping>
</MYDB>
i perform the linq to XML query :
XDocument xmlDoc = XDocument.Load("c:\\MyFile.xml");
var mapNodes = (from mapNode in xmlDoc.Elements("Mapping")
where mapNode.Attribute("LocationInFile").Value == "0"
select mapNode.Element("Map")).Single();
i get no results, why ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|