473,322 Members | 1,734 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.

Need Help with INI app

I need to store data in, update, and read data from an XML file.

An INI structure worked fine:

[Zone 01]
a= 123
b= xyz
c= etc

[Zone 02]
.....

I've been look around the net and cannot find a simple comprehesive example
on how to convert this to VB.Net and System.Xml. Biggest problem is that the
sample files do not seem to be structure such that the data can be retrived
by "zone name" from the above example.

First issue is how do I structure the XML file to make updates and queries?

I'm working with this design currently:

<Zones>
<Zone Name="Zone 01">
<a>123</a>
<b>xyz</c>
<c>etc</c>
</Zone>
<Zone Name="Zone 02">
<a>2</a>
....
</Zones>

Is this a good layout for SIMPLE adds, updates and reading?

I'm really lost beyond the layout too - I'm thinking SelectNodes and
SelectSingleNodes is the way to go to get data out but I can't get any XPATH
strings to work with the above design.

Haven't a clue on adds and updates.

Should I be using a different design? I need to work with the data a "zone"
at a time, usually only one zone during a session.

Does anyone know of a good book/sample/white paper that addresses the above
application in VB?

Or perhaps this is simple enough a few examples of adds(new zones), updates,
and reads could be posted?

Thanks!
Jul 30 '06 #1
2 1362
So - I guess my impression of XML as a pathetic academic naval gazing
exercise is confirmed.

I have concluded that the reason I cannot find a god example on how to
replace an INI file with a XML file is because the tool is too weak.

I have always wonder about the strange example files used to demo/teach XML
in that they always seemed to be worthless as data records. Now I understand
the examples were designed to support what XML can do, which is very little
when it comes to storing data.

Amazing, all that "elegant" design and it can't even replace a simple INI
file.
"Bob Heitzman" wrote:
I need to store data in, update, and read data from an XML file.

An INI structure worked fine:

[Zone 01]
a= 123
b= xyz
c= etc

[Zone 02]
....

I've been look around the net and cannot find a simple comprehesive example
on how to convert this to VB.Net and System.Xml. Biggest problem is that the
sample files do not seem to be structure such that the data can be retrived
by "zone name" from the above example.

First issue is how do I structure the XML file to make updates and queries?

I'm working with this design currently:

<Zones>
<Zone Name="Zone 01">
<a>123</a>
<b>xyz</c>
<c>etc</c>
</Zone>
<Zone Name="Zone 02">
<a>2</a>
...
</Zones>

Is this a good layout for SIMPLE adds, updates and reading?

I'm really lost beyond the layout too - I'm thinking SelectNodes and
SelectSingleNodes is the way to go to get data out but I can't get any XPATH
strings to work with the above design.

Haven't a clue on adds and updates.

Should I be using a different design? I need to work with the data a "zone"
at a time, usually only one zone during a session.

Does anyone know of a good book/sample/white paper that addresses the above
application in VB?

Or perhaps this is simple enough a few examples of adds(new zones), updates,
and reads could be posted?

Thanks!
Aug 1 '06 #2
Figured out the soultion was to not use .Net SQL to work with records in a
XML formated data file. Used dataset instead. Using the dataset bound to a
DataGridView allowed for in place edit, adds, and deletes. Need a seed file
to get started (or go through the effort to expand solution to use schemas.

Imports System.IO
Public Class Form1
Dim ds As DataSet

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
ds = New DataSet
ds.ReadXml("C:\DevVS2005\XML_Test\XML_Test\XMLFile 1.xml")
dgv1.DataSource = ds
dgv1.DataMember = "Authors"
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
ds.WriteXml("C:\DevVS2005\XML_Test\XML_Test\XMLFil e1.xml")
End Sub
End Class

Typical data:
<Authors_Table>
<authors>
<au_id>172-32-1176</au_id>
<au_lname>Blue</au_lname>
<au_fname>Johnson</au_fname>
<phone>408 496-7223</phone>
<address>10932 Bigge Rd.</address>
<city>Menlo Park</city>
<state>CA</state>
<zip>94025</zip>
<contract>true</contract>
</authors>
....
</Authors_Table>
Aug 1 '06 #3

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

Similar topics

0
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its...
7
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
15
by: drdoubt | last post by:
using namespace std In my C++ program, even after applying , I need to use the std namespace with the scope resolution operator, like, std::cout, std::vector. This I found a little bit...
9
by: sk | last post by:
I have an applicaton in which I collect data for different parameters for a set of devices. The data are entered into a single table, each set of name, value pairs time-stamped and associated with...
3
by: Bob.Henkel | last post by:
I write this to tell you why we won't use postgresql even though we wish we could at a large company. Don't get me wrong I love postgresql in many ways and for many reasons , but fact is fact. If...
3
by: google | last post by:
I have a database with four table. In one of the tables, I use about five lookup fields to get populate their dropdown list. I have read that lookup fields are really bad and may cause problems...
4
by: Phil | last post by:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and made into a TIF file and placed on the client (could be in temp internet dir). The reason we need it in TIF format is...
8
by: Sai Kit Tong | last post by:
In the article, the description for "Modiy DLL That Contains Consumers That Use Managed Code and DLL Exports or Managed Entry Points" suggests the creation of the class ManagedWrapper. If I...
2
by: Michael R. Pierotti | last post by:
Dim reg As New Regex("^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$") Dim m As Match = reg.Match(txtIPAddress.Text) If m.Success Then 'No need to do anything here Else MessageBox.Show("You need to enter a...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
1
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: 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: 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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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

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.