Converting XMLDatadocument for dataset

G

Guest

Hi,
I have to pass XML data to a procedure.
I'm having xml data in XMLDataDocument datatype.
Now i want to use this XMLDataDocument as an input to the dataset inside the
procedure.
But dataset.ReadXML accpets only Textreader/Stream/XMLReader.
Can anyone pls tell me how to convert the XMLDataDocument into
Textreader/Stream/XMLReader??

my code looks similar to something like this:

Private Sub Procedure1(ByVal xmldoc As XmlDataDocument)
//here i will call ReadXML method
ds.ReadXML(xmldoc).
 
A

AMDRIT

Seems like you will need a system.io.stream (or some variant) to do as you
wish.

check out
http://www.syncfusion.com/library/cpref/html/frlrfsystemiomemorystreamclasstopic.htm

I don't know what an XMLDataDocument is, but if it has the .XML property
(returning the xml string of its contents) or the WriteXML method then you
are all set.

dim objStream as IO.MemoryStream
dim b() as byte = system.text.encoding.ascii.getbytes(xmlDoc.xml)
objStream.Read(b,0,b.length)

or

dim objStream as IO.MemoryStream
xmlDoc.WriteXML(objStream)


.... Then ...

ds.ReadXML(objStream)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top