views:

69

answers:

1

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?

+1  A: 

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"
Murph
do you have any tutorial for this subject-Linq Query??
Vibin Jith
@Vibin - not specifically no. Learnt mine from a combination of reading Linq in Action (manning), and of actually doing stuff with reference to numerous blogs etc.
Murph