【问题标题】:Verify linq query [closed]验证 linq 查询 [关闭]
【发布时间】:2011-08-29 17:19:16
【问题描述】:

我正在将 vb 代码转换为 c#,不幸的是我现在无法访问数据库,我无法检查我的代码是否良好。

 Dim xmlDoc As XDocument
                xmlDoc = XDocument.Parse(e.Result)
                Dim supportNode = xmlDoc...<SUPPORT>
                PhoneNumberLabel.Text = supportNode.First().Element("SUPPORTPHONE").Value
                EmailLabel.Text = supportNode.First().Element("SUPPORTEMAIL").Value
                TrainingPhoneLabel.Text = supportNode.First().Element("TRAININGPHONE").Value

这是c#中的这段代码......我认为

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;

你能检查一下吗

【问题讨论】:

    标签: c# .net xml vb.net linq


    【解决方案1】:

    两个源代码是等价的。

    【讨论】:

      猜你喜欢
      • 2013-02-13
      • 1970-01-01
      • 2018-09-08
      • 2021-01-28
      • 1970-01-01
      • 2014-07-13
      • 1970-01-01
      • 1970-01-01
      • 2018-08-07
      相关资源
      最近更新 更多