Hi all,
I have a xml file on which I want to make a query to display all articles with certain Id's in it.This is what I tried but somehow I can't get it to work. I looked around and all I could find were examples using linq to sql.
Any help would be appreciated...
Cheers, Terry
The id's are stored like this in the xml
<relatedcontent articleID="1, 2, 3, 4" />
Here's my linq
var mylinks = (from item in relatedLinks.Descendants("link")
where item.Attribute("linkID").Value.Contains("1, 2")
select new
{
testlink = item.Value
});
foreach (var newarticles in mylinks)
{
Response.Write(newarticles .testlink);
}