Results 1 to 8 of 8

Thread: [RESOLVED] More 3.0 to 3.5 issues

Threaded View

  1. #1

    Thread Starter
    Fanatic Member staticbob's Avatar
    Join Date
    Jan 2005
    Location
    Manchestershire, UK Cabbage: I do
    Posts
    619

    Resolved [RESOLVED] More 3.0 to 3.5 issues

    Guys,

    I have to take a project from 3.5 down to 3.0.
    The 3.5 project is making use of the linq.xdocument in the following code, can somebody show how I do this in 3.0 please?

    I've replaced the xdocument with xmldocument, but the ".Descendants" is giving me erros now obviously.

    Ta
    Bob


    Code:
                'This gets the questions with any completed data.
                Dim document As XmlDocument = XmlDocument.Load(Session("str_XMLDataFile"))
    
                Dim sectionName As String = XPathBinder.Eval(DataBinder.GetDataItem(e.AccordionItem), "@SectionName").ToString()
    
    
                Dim questions = From question In document.Descendants("Question") _
                                Where question.Parent.Attribute("SectionName").Value = sectionName _
                                Select Text = question.Element("Text").Value, _
                                    Comment = question.Element("Comment").Value, _
                                    VDSCode = question.Element("VDSCode").Value, _
                                    Category = question.Element("Category").Value, _
                                    YesNo = question.Element("YesNo").Value
    Last edited by staticbob; Feb 15th, 2009 at 06:02 PM.
    "I dislike 7 am. If 7 am were a person, I would punch 7 am in the biscuits." - Paul Ryan, DailyRamblings

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width