473,800 Members | 3,007 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help Writing to XML File

Hello All,
I am stuck on a problem with updating an XML file. Here is what my
final solution suppose to do. I have a web form which displays all
users that are authorized for recieving a particular application. To
display the users, a manager will select the product from a drop down
menu and then the form (FORM 1) will use the selecteditem.va lue to
query the xml file to find all users and then display the users in a
datagrid. This is working great.

Now the problem I am having is that the manager can also add and delete
users for a particular product. (FORM 2) Remember that there can be
many users per a particular product. How will I implement this process.
I was thinking about using XPath, but I could not find any solutions
out there similar to mine. Any help would be a great learning process
for me and greatfull.

Below is the webform layout and the XML file layout.

WEBFORM:

Product Name - DropdownList
FirstName - Textbox
MiddleInitial - Textbox
LastName - Textbox
Email - Textbox

Add - Checkbox
Delete - Checkbox
Save - ASP:Button to call a function

XML FILE:

<EmpType>
<ProductName>Ad obe</ProductName>
<EmployeeName>J ohn,S,Doe,Jo*** *****@email.com </EmployeeName>
<EmployeeName>J ane,S,Doe,Ja*** *****@email.com </EmployeeName>
</EmpType>

SENARIO 1:
A manager goes to FORM2 and select Adobe from the dropdownlist.
He enters the following information on the form:
FirstName: John
MiddleInitial: S
LastName: Doe
Email: Jo********@emai l.com
and Delete Checkbox = true

and he clicks on Save!

The function now searchs through the XML file and finds for a user with
the given information under the product Adobe and deletes the node. It
will do the same for add exept it will add a node.
Thanks Again

Jan 6 '06 #1
3 1274
If multiple managers make an update at the same instant, how do you ensure
consistency of the XML? There is no easy way to solve this. Your best
best is to use a database & let the database handle it.

If you have to persist the & maintain the data as XML, using an ADO.NET
dataset will simplify the amount of work you have to do, for the search +
add/delete. You still have write code to handle concurrent updates.

Cheers,
-Naraen

<ma**********@g mail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.com.. .
Hello All,
I am stuck on a problem with updating an XML file. Here is what my
final solution suppose to do. I have a web form which displays all
users that are authorized for recieving a particular application. To
display the users, a manager will select the product from a drop down
menu and then the form (FORM 1) will use the selecteditem.va lue to
query the xml file to find all users and then display the users in a
datagrid. This is working great.

Now the problem I am having is that the manager can also add and delete
users for a particular product. (FORM 2) Remember that there can be
many users per a particular product. How will I implement this process.
I was thinking about using XPath, but I could not find any solutions
out there similar to mine. Any help would be a great learning process
for me and greatfull.

Below is the webform layout and the XML file layout.

WEBFORM:

Product Name - DropdownList
FirstName - Textbox
MiddleInitial - Textbox
LastName - Textbox
Email - Textbox

Add - Checkbox
Delete - Checkbox
Save - ASP:Button to call a function

XML FILE:

<EmpType>
<ProductName>Ad obe</ProductName>
<EmployeeName>J ohn,S,Doe,Jo*** *****@email.com </EmployeeName>
<EmployeeName>J ane,S,Doe,Ja*** *****@email.com </EmployeeName>
</EmpType>

SENARIO 1:
A manager goes to FORM2 and select Adobe from the dropdownlist.
He enters the following information on the form:
FirstName: John
MiddleInitial: S
LastName: Doe
Email: Jo********@emai l.com
and Delete Checkbox = true

and he clicks on Save!

The function now searchs through the XML file and finds for a user with
the given information under the product Adobe and deletes the node. It
will do the same for add exept it will add a node.
Thanks Again

Jan 7 '06 #2
Hey Naraen,
Thanks for the reply. Actually there is a list of 1000 products. Each
products have different managers. So there should not be a problem of a
particualr product being accessed at the same time by two different
managers. I will need to use XML because the team currently have Access
DB which they monitor their product information and then export certain
data to XML.

Jan 9 '06 #3
Hey Naraen,
Thanks for the reply. Actually there is a list of 1000 products. Each
products have different managers. So there should not be a problem of a
particualr product being accessed at the same time by two different
managers. I will need to use XML because the team currently have Access
DB which they monitor their product information and then export certain
data to XML.

Jan 9 '06 #4

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

Similar topics

2
3058
by: lawrence | last post by:
I've been bad about documentation so far but I'm going to try to be better. I've mostly worked alone so I'm the only one, so far, who's suffered from my bad habits. But I'd like other programmers to have an easier time understanding what I do. Therefore this weekend I'm going to spend 3 days just writing comments. Before I do it, I thought I'd ask other programmers what information they find useful. Below is a typical class I've...
48
8514
by: Joseph | last post by:
Hi I'm writing a commercial program which must be reliable. It has to do some basic reading and writing to and from files on the hard disk, and also to a floppy. I have foreseen a potential problem. The program may crash unexpectedly while writing to the file. If so, my program should detect this during startup, and then (during startup) probably delete the data added to the file and redo the writing operation.
3
3408
by: ishekar | last post by:
Hi, I have an application where i want to write data to a file, the data is being sent from an external source. I know the total size of the data and then i retrieve the data in small segments from the source. This data is written to file in a loop. My question. 1. Will it be useful to increase the file size initially then seek to 0 and start writing to file. whether there will be any performance improvements
4
2094
by: mb | last post by:
what is the best way to do this: In a game I want to a class called "Items". This class will have the game items public class Items { public int Chair public int Table . . .and so on . . .
22
2138
by: macAWM | last post by:
Hi list, First let me explain that my background is in Java and I am quite spoiled to its niceties (read "less ambiguous nature"). Anyway to my problems. 1. I want to write my own library for what I consider to be some holes in the standard language. How do I go about writing and compiling this without this stupid error about not having a 'main' function. I don't want a stupid 'main' function. (I'm compiling using gcc 4.0.) I would...
0
1260
by: kid4rilla | last post by:
I can successfully write the binary data to an image data type, and successfully retrieve it, but when I attempt to play the file in media player after retrieving it, I get the file type isn't supported. I must be losing something somewhere, but the byte lengths match up. Is there some encoding I need to do. Please take a look, and suggestions would be appreciated.
1
2591
by: Rizwan | last post by:
I am writing this code for file upload in asp 3.0 on my webpage........ It is working on local system but when i want to upload an image on my website from client machine it is not working ....... can somebody help me <%@ Language=VBScript %> <%Option Explicit%>
6
1600
by: xansar | last post by:
I have searched through Google for about an hour with nothing to show for it. I'm pretty sure I'm doing the actual return part right, but I'm not too sure what to do with the return once it's back in main(). I basically just need to know how to put the data from the importMarks() function to main(), the goal here is to have all the data in main() in a normal int array where I can use it like I normally would. The code is simple enough: ...
3
2699
by: Barry Flynn | last post by:
Hi I am working with a VB 2005 program which has been converted from VB6. It writes data out to a flat file, with code like the following line WriteLine(riFileNo, "Hist", lsAssetID, lsRecordType, lsXNbr, lsFiscYr, "Beg", CStr(H.BegBalAccDepn), CStr(H.BegBalCost), CStr(H.BegBalCostReval), CStr(H.BegBalDepCost), CStr(H.BegBalDepnReval)) The program is running from within a Virtual PC
5
1802
by: alck1234 | last post by:
Hi, I need help on my mini project on object orientated programming. The question goes like this: A mini-mart has just installed a bar code reader to improve efficiency at their checkouts. Assume that the bar code is to access a file that store the product descriptions, unit price and quantity of each product sold in the shop. Assume that there are only 10 products in
0
9694
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10256
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10039
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7584
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6824
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5477
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4152
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2953
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.