473,472 Members | 2,140 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Read XML Data from a Page ?

WJ
**: I m doing a cross-post here. it seems that XML folks does not deal with
Asp.Net form **

When you click on a link from a web site, it gives you a page exactly like
the following. How can I extract the data using code-behind without
requiring user to perform a "Save As" to an XML file ? I would like to read
the data and record it to a database without user touching it ! (My page is
..aspx)

************************************************** ****
<?xml version="1.0" encoding="utf-8" ?>
- <NameList>
- <Names>
<LastName>Hamilton</LastName>
<FirstName>Rick</FirstName>
<MiddleNamae>M</MiddleNamae>
</Names>
- <Names>
<LastName>Elton</LastName>
<FirstName>John</FirstName>
<MiddleNamae>D</MiddleNamae>
</Names>
</NameList>
************************************************** ****

Thanks

John

Nov 19 '05 #1
2 854
Hi,

you can do this by using System.Net:

WebClient client = new WebClient();
string xml = System.Text.Encoding.UTF8.GetString(client.Downloa dData(url));
// process xml...

**: I m doing a cross-post here. it seems that XML folks does not deal with
Asp.Net form **

When you click on a link from a web site, it gives you a page exactly like
the following. How can I extract the data using code-behind without
requiring user to perform a "Save As" to an XML file ? I would like to read
the data and record it to a database without user touching it ! (My page is
.aspx)

************************************************** ****
<?xml version="1.0" encoding="utf-8" ?>
- <NameList>
- <Names>
<LastName>Hamilton</LastName>
<FirstName>Rick</FirstName>
<MiddleNamae>M</MiddleNamae>
</Names>
- <Names>
<LastName>Elton</LastName>
<FirstName>John</FirstName>
<MiddleNamae>D</MiddleNamae>
</Names>
</NameList>
************************************************** ****

Thanks

John

Nov 19 '05 #2
WJ

"Denny Britz" <zo***@web.de> wrote in message
news:OU**************@TK2MSFTNGP09.phx.gbl...
Hi,

you can do this by using System.Net:

WebClient client = new WebClient();
string xml =
System.Text.Encoding.UTF8.GetString(client.Downloa dData(url));
// process xml...


Thanks Denny, That works very nicely.

John
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Sebastian Krause | last post by:
Hello, I tried to read in some large ascii files (200MB-2GB) in Python using scipy.io.read_array, but it did not work as I expected. The whole idea was to find a fast Python routine to read in...
11
by: Markus Breuer | last post by:
I have a question about oracle commit and transactions. Following scenario: Process A performs a single sql-INSERT into a table and commits the transaction. Then he informs process B (ipc) to...
18
by: jas | last post by:
Hi, I would like to start a new process and be able to read/write from/to it. I have tried things like... import subprocess as sp p = sp.Popen("cmd.exe", stdout=sp.PIPE)...
19
by: Holger Hasselbach | last post by:
- The value of the object allocated by the malloc function is used (7.20.3.3). - The value of any bytes in a new object allocated by the realloc function beyond the size of the old object are used...
2
by: Julie | last post by:
I'm wondering what standard/best practices are for the following scenario: I have a page representing several fields for stored data. If the user has sufficient access privileges, the page is...
2
by: keithb | last post by:
This is on a remote server. Everything works in the development envirmonment. Any ideas? Thanks, Keith Failed to update database "C:\BTM_ROOT\APP_DATA\ASPNETDB.MDF" because the database is...
4
by: Francois Stander | last post by:
Hi, hope someone can help me. It seems imposible to read data from a server, however, I can read the validation data from the server and hold it in dataviews . datasets or data tables in my asp...
10
by: CDFTim | last post by:
O.K. that was a long Title... Can you help / show me how I would......... I am going to long windedly try to paint this picture. Backround: I have an html page that has a marquee function in it to...
1
Oodles Of Noodles
by: Oodles Of Noodles | last post by:
Hello fellow geeks I have a problem in my database iVB .Net program that is generating 'Error:Invalid attempt to read when no data is present.' The weird part is that when you call the page from...
3
by: sriram347 | last post by:
Hi I am a newbie to ASP.NET. I developed a web page (project type is web application) and I keep getting this error. B]Error message : "System.AccessViolation Exception attempted to read or...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.