Read Xml data
From: Martyn Fewtrell (mfewtrell_at_networkclub.co.uk)
Date: 07/26/04
- Next message: SMG: "IMP:ValidationSummary/CustomValidator/ResetBtn"
- Previous message: Shiva: "Re: Adding javascript event to datagrid control"
- Next in thread: John Saunders: "Re: Read Xml data"
- Reply: John Saunders: "Re: Read Xml data"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 26 Jul 2004 13:26:16 +0100
I am having a problem reading an Xml file and loading it into a dataset in
VB.net (ASP).
I seem to be able to load the remote file from the Url but once in memory I
cant manage to load it in to a dataset.
The readXml appears to want to read a file rather than a variable and I'm
not sure how to get around this issue.
I've tried loading to a file stream and converting the strFile to an
XmlDocument but this doesn't appear to get me any further.
I known the code at the bottom doesn't work I have listed it to put over the
idea of what I am trying to do.
Martyn Fewtrell
mfewtrell@networkclub.co.uk
--------------------------------------------
'get data
Dim Url As String = "http://www.url/file.xml"
Dim Request As HttpWebRequest
Dim Response As WebResponse
Dim strFile As String
Try
Request = CType(WebRequest.Create(Url), HttpWebRequest)
Response = Request.GetResponse()
litError1.Text = "Response Recieved"
Catch ex As Exception
litError1.Text = "Response Not Recieved"
End Try
'load Dataset
Dim ds As DataSet = New DataSet
ds.ReadXml(strData)
----------------------------------------------------------------------------
- Next message: SMG: "IMP:ValidationSummary/CustomValidator/ResetBtn"
- Previous message: Shiva: "Re: Adding javascript event to datagrid control"
- Next in thread: John Saunders: "Re: Read Xml data"
- Reply: John Saunders: "Re: Read Xml data"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|