Vibin Jith
Vibin Jith

Reputation: 931

How to write linq query for xml in vb.net?

I want to write a link query for my xml. Actually i dont know it. i have write some code here.

 Dim query = _
     From p In MyPermissionXml.Elements("menuNode").Descendants("menuNode") _
         Where p.Attributes("title").ToString = "Company"

from where clause , i think it's wrong. how to represent an attribute here?

Upvotes: 0

Views: 900

Answers (1)

Murph
Murph

Reputation: 10190

I think if you change Attributes to Attribute and ToString to Value and you should be there

Dim query = _ 
    From p In MyPermissionXml.Elements("menuNode").Descendants("menuNode") _ 
        Where p.Attribute("title").Value = "Company"

Upvotes: 1

Related Questions