[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

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

Posted on 2008-10-07
1
Medium Priority
?
232 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 14

Accepted Solution

by:
raja_ind82 earned 1500 total points
ID: 22661402
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

656 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