Getting web service dataset into xml

J

John

Hi

I need to access to a web service method that returns a dataset type. Is
there a way to store this remote dataset as an xml file locally, using
vb.net, so I can open a local dataset on the xml? A code example would be
appreciated.

Thanks

Regards
 
O

One Handed Man \( OHM - Terry Burns \)

Once the data is in the dataset, you can use its WriteXML and ReadXML
methods to persist the data locally.

HTH

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .

Time flies when you don't know what you're doing
 
J

John

Hi

Thanks for this. A code example would be great. If there is another way to
get a remote dataset into a local table than that would be even better.

Thanks

Regards
 
C

Cor Ligthert

Hi John,

Again, I have given you a sample that should be completly working however
you are ignoring it, again, may I know why?

Cor
 
C

Cor Ligthert

Hi Greg,

Where is the Webservice in this sample?

All regulars in this newsgroup know the XMLwrite and XMLread without
thinking.

When you drop a link, than a good one please not so very much basic.

Cor
 
M

Mike McIntyre [MVP]

You addressed your email to Greg but it is a reply to my post. I am Mike.

The link contains the code that answers the posters requirement "to store
this remote dataset as an xml file locally"

The code in the article is:

Private Sub WriteXmlToFile(thisDataSet As DataSet)
If thisDataSet Is Nothing Then
Return
End If
' Create a file name to write to.
Dim filename As String = "myXmlDoc.xml"
' Create the FileStream to write with.
Dim myFileStream As New System.IO.FileStream _
(filename, System.IO.FileMode.Create)
' Create an XmlTextWriter with the fileStream.
Dim myXmlWriter As New System.Xml.XmlTextWriter _
(myFileStream, System.Text.Encoding.Unicode)
' Write to the file with the WriteXml method.
thisDataSet.WriteXml(myXmlWriter)
myXmlWriter.Close()
End Sub


Cor, I don't know who the regulars but my post provided the user a way to do
what was requested and so I posted it. I don't understand why you are making
a request for me to not post basic information when it appears that is what
a poster has requested. What I posted may not be what the poster requested
but that is always a potential outcome of any help given.

Is this newsgroup for advanced users only?

Are there some Microsoft rules about this newsgroup I need to know?

Thanks,

--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com
 
C

Cor Ligthert

Hi Mike,

I see now that the post of John can be confusing. He had asked before this
in this newsgroup.
How can I make my vb.net app to run as service? This app reads a dataset
from a web service method and saves it in a local access table.

Knowing this than your answer is in my opinion not of much sense, however
reading the way he stated the question in this thread I can imaging why you
posted your link and it is posible he changed his mind.

So sorry for my mistake.

Cor
 
C

Cor Ligthert

Hi Mike,

Now I see why I sand the message, look at the answer from OHM in this thread
and the reaction from John on this, which all are far before your message.

Cor
 
C

Cor Ligthert

Mike McIntyre said:
Are there some Microsoft rules about this newsgroup I need to know?

I thougth more on respect on other senders not on Microsoft rules, I think
that that is the behaviour of Microsoft as well.

However when you say that are not Microsoft rules I have to believe you.

Cor
 
M

Mike McIntyre [MVP]

Cor,

Great! We are sync'd. The OHM suggested the solution, John requested code,
I provided it.

Thanks for clarifying.

Mike
 
C

Cor Ligthert

I see,
Great! We are sync'd. The OHM suggested the solution, John requested code,
I provided it.

And with that ignoring my answer to John

The code you provided is by the way very confusing, a simple
ds.writeXML(path) does the trick as well.

Cor
 

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