473,396 Members | 1,961 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.

updating a xml document using C#

i d be very glad if anyone can come up with a solution to update several equal positions of a xmlDocument without changing its structure and with a single click..,using C# ....thanks
May 8 '07 #1
1 6019
Hi madhukar...
recently i did the same thing ..

wht i did is i hav some 10 textboxes..once i entered the value like ID in the textbox,all the vales to be displayed in the remaining textboxes.. here the XML file is the backend..no databse plz.

once you did any changes to the vales and click on the update button the chnages have to reflected on to th eoriginal XML file.

this is the code...


XmlNode node = doc.DocumentElement;
foreach (XmlNode nd in node.ChildNodes)
{

foreach (XmlNode nd1 in nd.ChildNodes)
{

if (nd1.InnerXml.ToString()== edit_mobileno.Text.ToString())
{

if (nd.NodeType == XmlNodeType.Element)
{
//MessageBox.Show(nd.ChildNodes.Count.ToString());
for(int i=0;i<13;i++)
{
nd.ChildNodes[i].InnerXml=st[i];
//MessageBox.Show("changed");

}
doc.Save(@"D:\Newfolder\tirumala\myxml.xml");
MessageBox.Show("record updated succesfully in the XML file");

}

break;

}

}

}

i d be very glad if anyone can come up with a solution to update several equal positions of a xmlDocument without changing its structure and with a single click..,using C# ....thanks
May 8 '07 #2

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

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
3
by: Jim Cobban | last post by:
I have a set of web pages that are organized in pairs. One of each pair contains a graphic and the other is an extended description of the graphic. I am trying to set it up that selecting a single...
14
by: el_sid | last post by:
Our developers have experienced a problem with updating Web References in Visual Studio.NET 2003. Normally, when a web service class (.asmx) is created, updating the Web Reference will...
2
by: Rob Long | last post by:
Hi I have an HTML select element in my page and it's multiple property is disabled (one item at a time mode) but I still want to transfer all the items in the select to the server when the form...
1
by: mrtm3050 | last post by:
I want to try to update a pre-existing html page by adding a certain tag <option> within a <select> tag. The code used below: function showDuplicate() { if (!newWin || newWin.closed){ newWin...
2
by: rpjd | last post by:
I am trying to submit entries in a form to a database. I am using " within my submission form and $_POST I am getting the connection to the database but I my script is not executing,...
5
by: rosaryshop | last post by:
I'm working a jewelry/rosary design web site at http://www.rosaryshop.com/rosariesAndKits2.php. As the user makes selections, it updates images of various parts, giving them a preview of the...
2
by: YouPoP | last post by:
Hi, I am doing an MFC MDI application with VS 8.0. I am using the default document view plus a formview ans show both of them in the view using a splitter. In the formview there is an event...
2
by: =?Utf-8?B?TUNN?= | last post by:
I have an asp.net page that contains an update panel. Within the update panel, controls get added dynamically. During partial page post backs the controls within the panel will change. I have a...
0
by: sujata321 | last post by:
Hi, I need to update an XML file using ASP and javascript/vbscript. But this is not working.It is showing the error – ‘document’ is not defined –in the line ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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,...

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.