Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

read xml doc

Status
Not open for further replies.

logic4fun

Programmer
Apr 24, 2003
85
US
All,
This is my first day in ASP and also WEB programming and i am looking into a requirement which is on my plate when someone is on vacation.

There is a HTML page which returns data in XML format.

Something like this


Result:
- <response>
- <row>
<START_DATE>2006-05-17</START_DATE>
<INTERVAL>2006-05-17-00.00.00.000000</INTERVAL>
<SOURCE>2</SOURCE>
</row>
- <row>
<START_DATE>2006-05-17</START_DATE>
<INTERVAL>2006-05-17-00.00.00.000000</INTERVAL>
<SOURCE>3</SOURCE>
</row>
- </response>


------------------

All i need to know is how to read this webpage and load this data into my local database. Need to do it in ASP since all the subsequent pages designed are in ASP.

Any help is greatly appreciated

Thanks
 
One approach is that you could create a ReqEx to scrape the screen, then take parse through that and create a recordset and update your database.

It's interesting that they don't give you the data in a stream. Then you could just use Request.InputStream and put that into a Stream.

Anyhow, hope that helps
T
 
If you can isolate the XML, like tperri has suggested, and save it into a file, you can create a dataset and use the ReadXML method and update the database.

Jim
 
Code:
string yourUrl = "[URL unfurl="true"]http://www.blahblah.com";[/URL] //or whatever

XmlTextReader reader = new XmlTextReader(yourUrl);
DataSet quickAndDirtyDeserializer = new DataSet();
quickAndDirtyDeserializer.ReadXml(reader);

int indexYouWant = 2; //or whatever
DataTable oneYouWant = quickAndDirtyDeserializer.Tables[indexYouWant];

//go nuts with a DataAdapter to push changes back to database
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top