Results 1 to 12 of 12

Thread: Download XML file

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2016
    Posts
    8

    Download XML file

    Hello,

    Problem: I would like to download a XML file with exchange rates so I can further upload it into a SQL Server table.

    For the XML download, this is the code I have so far:
    Code:
    Dim webRequest As WebRequest = WebRequest.Create("https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist.xml")
    Dim webResponse As WebResponse = webRequest.GetResponse
    Dim webStream As Stream = webResponse.GetResponseStream
    
    Dim reader As New StreamReader(webStream)
    reader.ReadToEnd()
    
    Dim xmlDoc As New XmlDocument
    xmlDoc.Load(webStream)
    I do see the data in webStream, but how can I save it to a XML file? I thought xmlDoc.Save would do the trick, but it doesn't.

    Thank you in advance
    Last edited by dday9; Mar 17th, 2021 at 12:20 PM. Reason: Formatted code and added code tags

Tags for this Thread

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