Solved

i need to write to an xml file, from an xml file i have created

Posted on 2008-10-07
1
208 Views
Last Modified: 2013-11-08
Hi,

I am using vb.net to read an xml file with basic user information.  I want to be able to write back to a new xml file, and maybe do some logic like bind firstName and surName elements together.

Any clues of writing, using the elements already obtained from the read function?

Thanks

Julia
Public Sub MigrateFromOldToNew()
      
 
 
        Dim xmlFilePath As String = HttpContext.Current.Server.MapPath("Students.xml")
 
        Try
            Using reader As XmlReader = XmlReader.Create(xmlFilePath)
 
                While (reader.Read)
                    If (reader.NodeType = XmlNodeType.Element) Then
 
                        If (reader.Name = "StudentId") Then
                            studentId = reader.ReadInnerXml
                        End If
 
                        If (reader.Name = "StudentName") Then
                            studentName = reader.ReadInnerXml
                        End If
 
                        If (reader.Name = "StudentSurname") Then
                            studentSurname = reader.ReadInnerXml
                        End If
                    End If
                End While
 
            End Using
        Catch ex As Exception
 
        End Try
 
 
 
 
    End Sub

Open in new window

0
Comment
Question by:Juliafrazer
1 Comment
 
LVL 14

Accepted Solution

by:
raja_ind82 earned 500 total points
ID: 22661402
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

825 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