M
M. Posseth
Hello i have a problem
i have this peace of code
Dim xmldoc As XmlDocument = fobjXMLSendXMLRequest(strXml)
Dim nodeData As XmlNode = xmldoc.SelectSingleNode("tirep").Item("data")
Dim strdata As String = "<data>" & nodeData.InnerXml & "</data>"
Dim sw As New System.IO.StreamWriter("dmp")
sw.Write(strdata)
sw.Close()
Dim sr As New System.IO.StreamReader("dmp")
Dim dsBrands As New DataSet("brands")
dsBrands.ReadXml(sr)
sr.Close()
DataGrid1.DataSource = dsBrands
This works exactly as wanted however this peace
is in my opinion completely a waste of resources / time
Dim sw As New System.IO.StreamWriter("dmp")
sw.Write(strdata)
sw.Close()
Dim sr As New System.IO.StreamReader("dmp")
as you see the strdata contains xml data that i want to have in a data grid
, i tried to get it to work with a memory stream however then i get an error
, if i write the content of the memory stream to a debug window it is still
valid xml data
how should i go here what is the best solution to skip the IO part ??
as i receive the xml from a webservice as a string , i load it to a XML
document to select the required part
hope someone has a good idea to solve this
i have this peace of code
Dim xmldoc As XmlDocument = fobjXMLSendXMLRequest(strXml)
Dim nodeData As XmlNode = xmldoc.SelectSingleNode("tirep").Item("data")
Dim strdata As String = "<data>" & nodeData.InnerXml & "</data>"
Dim sw As New System.IO.StreamWriter("dmp")
sw.Write(strdata)
sw.Close()
Dim sr As New System.IO.StreamReader("dmp")
Dim dsBrands As New DataSet("brands")
dsBrands.ReadXml(sr)
sr.Close()
DataGrid1.DataSource = dsBrands
This works exactly as wanted however this peace
is in my opinion completely a waste of resources / time
Dim sw As New System.IO.StreamWriter("dmp")
sw.Write(strdata)
sw.Close()
Dim sr As New System.IO.StreamReader("dmp")
as you see the strdata contains xml data that i want to have in a data grid
, i tried to get it to work with a memory stream however then i get an error
, if i write the content of the memory stream to a debug window it is still
valid xml data
how should i go here what is the best solution to skip the IO part ??
as i receive the xml from a webservice as a string , i load it to a XML
document to select the required part
hope someone has a good idea to solve this