1 Answer
1

I doubt that "The Id does not exist in the current context" is actually the error message.

I think it's more likely to be:

The name 'Id' does not exist in the current context

... which is very different. That's saying it doesn't know which variable you're talking about. It's important to quote exact error messages.

Now, your question isn't very clear - at one point you're talking about searching for "a certain id" and later you talk about finding out comparing an id with "my id from another list". Do you have a variable with the id you're looking for? Is this just a typo, and it should be "id" instead of "Id"?

Yes I have a variable with an Id in it. And I want to compare this variable with the ID=... in the xml file. And yes about the error message you was right. Its "Name Id..."
–
ElisaAug 22 '10 at 21:25

@Lisa: What is that variable called though. It looks like it's not "Id". Just replace "Id" in your query with the actual name of the variable, and it could work... although only if it really is the first attribute of the element that you're looking for. (Why not look by the name of the attribute?)
–
Jon SkeetAug 22 '10 at 21:41

"(Why not look by the name of the attribute?)" this was my initial Intention but did not know how, so I choosed First() :P
–
ElisaAug 23 '10 at 20:17