473,322 Members | 1,473 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,322 software developers and data experts.

Updating an XML file in VB.net

Hi Guys,

I have a friend who is developing a dvd store in Visual basic ( It's a
WPF application) and stores the data in an XML file.

the content of the XML look like this:

<DVDInfo>
<DVD>
<DVDTitle>The Exorcist</DVDTitle>
<Director>William Friedkin</Director>
<Cast>Linda Blair</Cast>
<Description>Horror</Description>
<Rating>18</Rating>
<Cost>7.99</Cost>
<Copies>0</Copies>
<Rental>0</Rental>
<Image>Exorcist.jpeg</Image>
</DVD>
<DVD>
<DVDTitle>The Matrix</DVDTitle>
<Director>Wachowski</Director>
<Cast>Keanu Reaves</Cast>
<Description>Action</Description>
<Rating>15</Rating>
<Cost>7.99</Cost>
<Copies>20</Copies>
<Rental>0</Rental>
<Image>Matrix.jpeg</Image>
</DVD>
<DVD>
<DVDTitle>The Sahara</DVDTitle>
<Director>Breck Eisner</Director>
<Cast>Matthew McConaughey</Cast>
<Description>Action</Description>
<Rating>12</Rating>
<Cost>8.99</Cost>
<Copies>20</Copies>
<Rental>0</Rental>
<Image>sahara.jpeg</Image>
</DVD>
<DVD>
<DVDTitle>Constantine</DVDTitle>
<Director>Francis Lawrence</Director>
<Cast>Keanu Reaves</Cast>
<Description>Horror</Description>
<Rating>15</Rating>
<Cost>5.99</Cost>
<Copies>20</Copies>
<Rental>0</Rental>
<Image>Constantine.jpeg</Image>
</DVD>
</DVDInfo>

He needs a way to update the file so he can add other DVD's into the
file from a form in vb

He has a Textbox input for each node from DVD title through to Image
and a button on the form.

I had thought of using the XMLreader and XMLWriter within VB but don't
know how to go about it.

Can someone help?

thanks guys,
Jun 27 '08 #1
2 1773
<hu**********@googlemail.comschrieb
I had thought of using the XMLreader and XMLWriter within VB but don't
know how to go about it.

Can someone help?

I'd start here:
http://msdn2.microsoft.com/en-us/library/2bcctyt8.aspx
Armin

Jun 27 '08 #2
hu**********@googlemail.com wrote:
He needs a way to update the file so he can add other DVD's into the
file from a form in vb

He has a Textbox input for each node from DVD title through to Image
and a button on the form.

I had thought of using the XMLreader and XMLWriter within VB but don't
know how to go about it.
You can use System.Xml.XmlDocument
(<URL:http://msdn2.microsoft.com/en-us/library/20esef39%28VS.80%29.aspx>)
for that or with .NET 3.5 there is also LINQ to XML
(System.Xml.Linq.XDocument/XElement)
<URL:http://msdn2.microsoft.com/en-us/library/bb387098.aspx>.
And there is XML serialization/deserialization, that way you deal with
..NET objects in your code and the XML is created or parsed by
XmlSerializer. See
<URL:http://msdn2.microsoft.com/en-us/library/90c86ass(VS.80).aspx>
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jun 27 '08 #3

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

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? ...
45
by: It's me | last post by:
I am new to the Python language. How do I do something like this: I know that a = 3 y = "a" print eval(y)
6
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the...
1
by: Luis Esteban Valencia | last post by:
Hello Everyone, Iam an intermediate ASP.Net programmer and iam facing a challenging task. I have a table in MS-SQL server database called 'Members'. The table has following fields... ...
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...
6
by: muttu2244 | last post by:
hi all am updating the same file in ftp, through multiple clients, but am scared that two clients may open the same file at a time, and try updating, then the data updated by one data will be...
2
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of the mdb file increases dramatically (from 3-4 to...
4
by: rdemyan via AccessMonster.com | last post by:
My application is calculation intensive and the servers are agonizingly slow. Administrators of my application only update the backends once a month (twice a month max). So, my launching program...
3
by: Evan | last post by:
Hello - My script use a DB file which is written by XML, and the user load this DB file (XML tree in memory), and then do some updating about this tree, such as delete element, generate new...
16
by: Stevo | last post by:
I'm guessing this is a laughably obvious answer to many here, but it's not to me (and I don't have a server or any knowledge of PHP to be able to try it). It's not strictly a PHP question, but...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.