LINQ to XML query attributes

后端 未结 3 469
一整个雨季
一整个雨季 2021-01-13 04:30

using LINQ to XML, this is a sample of my XML


 
   

        
3条回答
  •  梦毁少年i
    2021-01-13 05:07

    Change this line:

    where feed.Attribute("Code").Equals("456")
    

    To:

    where feed.Attribute("Code").Value.Equals("456")
    

    Otherwise you're comparing the attribute as object instead of the attribute's value.

提交回复
热议问题