Verify linq query [closed]
I'm converting vb code to c#, and unfortunately I don't have now the access to database, and I can't check if my code is good.
Dim xmlDoc As XDocument
xmlDoc = XDocument.Parse(e.Result)
Dim supportNode = xmlDoc...<SUPPORT>
PhoneNumberLabel.Text = supportNode.First().Element("SUPPORTP开发者_JAVA百科HONE").Value
EmailLabel.Text = supportNode.First().Element("SUPPORTEMAIL").Value
TrainingPhoneLabel.Text = supportNode.First().Element("TRAININGPHONE").Value
and here is this code in c#...I think
XDocument xmlDoc = default(XDocument);
xmlDoc = XDocument.Parse(e.Result);
var supportNode = xmlDoc.Descendants("SUPPORT");
PhoneNumberLabel.Text = supportNode.First().Element("SUPPORTPHONE").Value;
EmailLabel.Text = supportNode.First().Element("SUPPORTEMAIL").Value;
TrainingPhoneLabel.Text = supportNode.First().Element("TRAININGPHONE").Value;
Could you check that it's ok
Both source codes are equivalent.
精彩评论