what im trying to do is, i have the following xml:
Postcode id=”E20 2AP” from=”test1″ to=”test2″/>
im trying to search for the postcode id and then get the from and to text from that id the code i have:
Public Shared Function GetFromDate(ByVal PostCode As String) As String
Dim LoadToAddresses = From ex In doc.Descendants.Elements("Postcode") Select New With {.accountName = ex.Attribute("id").Value, .datefrom = ex.Attribute("from").Value}
For Each x In LoadToAddresses
Dim datefrom = (From p In LoadToAddresses Where p.accountName = PostCode Select New With {.datefrom = p.datefrom}).Single
Return datefrom.ToString
Next
End Function
this works but it returns:
{ datefrom = test }
i just want it to state “test”
thanks
or: