The difference I see is the one that is not working has Descendant query
Fernando Soto
The second query will return a List with zero elements if no elements were found. So to find out if it found anything check the qty.Length property and see if it zero.
teknovation
ASKER
but the code breaks right at that condition, i wouldnt be able to check the length of qty
because if no elements are found in the XML document then the variable qty will have a List object with zero elements. Now if you try to index into qty then you will see that type of exception. Please post the complete code where this line is in.
correct so how do i check if there are no elements and how do i assign a "" to that varible. My code crashes when i assign it to the console window output