473,396 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Read XML file by aspx webpage .

i have a problem. the client is posting a xml page to given aspx page on server using GET method. Now i want to write script in that given aspx page so that it read that xml page and store elements in database.
my question is how will script read that xml file.
what objects we use...
Please help me....
i am searching all over net for this.
I am using C# and asp.net 2003

Thanks
Praveen
Nov 9 '06 #1
1 4537
protected void button1_Click (object sender, System.EventArgs e)
{
//use a filestream to get the data
FileStream fs = new FileStream("..\\..\\..\\books.xml",FileMode.Open);
XmlTextReader tr = new XmlTextReader(fs);

while(!tr.EOF)
{
//if we hit an element type, try and load it in the listbox
if(tr.MoveToContent()==XmlNodeType.Element)
{
LoadList(tr);
}
else
//otherwise move on
tr.Read();
}
}
private void LoadList(XmlReader reader)
{
try
{
listBox1.Items.Add(reader.ReadElementString());
}
//if an XmlException is raised, ignore it.
catch(XmlException er){}
}



In Button click Event i write a code to read the XML elements.My xml file name is Books.xml Instead of this u can give the URL from client.It will read the value if the NodeType is "Element".I add these values into ListBox.
Dec 6 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: nick | last post by:
I'm wondering if it's possible to access and use windows file icons in a webpage using, for example, the shell method SHGetFileInfo. I'm writing a small asp.net app to browse directories on a...
3
by: Joe | last post by:
Hi, I have written a webpage that allows a user to delete files in asp.net with I am having a small problem. To access this page a user has to login via login.aspx page. After successful...
17
by: chris.schwalm | last post by:
I would like to first state that I have searched through the archives and found a lot of related material, but am still new enough to javascript that I can't fit all the pieces together yet. So...
11
by: .Net Sports | last post by:
In VB.net, I'm trying to do a couple of things in a couple of different blocks of code. I need to take the first 25 characters of a text file, then append at the end some ellipses and a MORE link...
5
by: bobbyd | last post by:
Hi All, Does anyone know of a way to read an output from an external webpage/service? For example; The external source is on http://serverA:6010/sendoutput This page displays one line of...
7
by: =?Utf-8?B?SmVmZkRvdE5ldA==?= | last post by:
I have an asp.net application using a multi-page wizard control that grabs user selected files from a database and allows the user to configure parameters using controls on the wizard pages. The...
1
by: sspost | last post by:
i have a webpage ABC.aspx, where i am browsing for a file , when i get the file that i want to upload D:\document.pdf , i pass this D:\document.pdf to next webpage XYZ.aspx as string, so there is...
1
by: Rajen | last post by:
I've a automatic configuration proxy (http://xxx.xxx.xxx.xxx/xyz.pac) which I use in the Internet explorer Lan Settings to access the net. How do I read a webpage by specifying this proxy in my...
14
by: Joe | last post by:
this file is drawn in VB.NET and input output goes by XmlSerializer. Therefore, simple output file looks like: <?xml version="1.0" encoding="utf-8"?> <DrawablePicture...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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,...

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.