Add nodes to a new xmldocument using

Posted on 2007-10-03
Last Modified: 2012-06-27
I have the following code below in which I am taking an rss feed and converting a section of it into a string.....

What I need to take the node at each iteration of the For loop and add it back into a new xml.xmldocument....and then pass the full xml document to sqlserver adn store it as varchar I suppose...
not sure the best way to store it...but I need the entire xml file to be stored in one column of a database table.  My main concern is how to recreate the xml collection mentioned above....
Here is my code so far:

 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGrab.Click

        Dim xmldoc As New Xml.XmlDocument
        Dim xmlnlist As Xml.XmlNodeList
        Dim xmln As Xml.XmlNode
        Dim xmlRevDoc As New Xml.XmlDocument

            Dim strURL As String = ""

            xmlnlist = xmldoc.SelectNodes("//item/description")

            For Each xmln In xmlnlist
                Dim description = xmln.InnerText
                lblXML.Text += vbCrLf + description + vbCrLf + vbCrLf
        Catch ex As Exception
        End Try
    End Sub
Question by:Robb Hill
    1 Comment
    LVL 5

    Accepted Solution

    You should use a xmlDocument to do the work.

    Maybe something like

    element = xmlDocument.OwnerDocument.CreateElement(name)
    element.InnerText = text;

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
    Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now