Parsing XML from String

C

Chad Scharf

I am having difficulty taking an xml string passed as a
string from a web service. I am not using SOAP, but rather
calling the web service within an ASP.NET web form.
Reviewing the XML object model I am only finding file
parsing and I/O stream handling. Can anyone help out with
how this would be done?

This is just a simple test to get the returned method
values which are returned from the web service as a string.

private void cmdAirport_Click(object sender,
System.EventArgs e)
{
localhost.AirportInfo Fetch = new localhost.AirportInfo();
string Results;
if (txtCode.Text != "")
{
Results = Fetch.GetInfo(txtCode.Text);

txtResult.Text = Results;
}
}
 
B

BMermuys

hi,

That's great but I'm still having difficulty getting that
into a dataset.

string xmlData = "...";
System.IO.StringReader xmlSR = new System.IO.StringReader(xmlData);
myDS.ReadXml(xmlSR, XmlReadMode.Auto);
xmlSR.Close();



HTH,
greetings


 
C

Chad Scharf

Thank you, this works beautifully!
-----Original Message-----
hi,



string xmlData = "...";
System.IO.StringReader xmlSR = new System.IO.StringReader (xmlData);
myDS.ReadXml(xmlSR, XmlReadMode.Auto);
xmlSR.Close();



HTH,
greetings





.
 

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