开发者

Verify linq query [closed]

开发者 https://www.devze.com 2023-04-01 01:49 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消