LINQ to XML : A query body must end with a select clause or a group clause

前端 未结 6 1262
广开言路
广开言路 2021-01-20 01:31

Can someone guide me on to repairing the error on this query :

       var objApps = from item in xDoc.Descendants(\"VHost\") 
                          where         


        
6条回答
  •  半阙折子戏
    2021-01-20 02:36

    This may help:

            var objApps = from item in xDoc.Descendants("VHost")
                           from x in item.Descendants("Application")
                          select new clsApplication
                       {
                           ConnectionsTotal = item.Element("Application").Element("ConnectionsTotal").Value
                       };
    

提交回复
热议问题