473,467 Members | 1,441 Online
Bytes | Software Development & Data Engineering Community
Create 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.value 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>Adobe</ProductName>
<EmployeeName>John,S,Doe,Jo********@email.com</EmployeeName>
<EmployeeName>Jane,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********@email.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 1253
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**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.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.value 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>Adobe</ProductName>
<EmployeeName>John,S,Doe,Jo********@email.com</EmployeeName>
<EmployeeName>Jane,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********@email.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
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...
48
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...
3
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...
4
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
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...
0
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...
1
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 ..........
6
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...
3
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,...
5
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....
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,...
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
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 ...

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.