473,800 Members | 2,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
SelectSingleNod es 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 1387
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
SelectSingleNod es 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(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
ds = New DataSet
ds.ReadXml("C:\ DevVS2005\XML_T est\XML_Test\XM LFile1.xml")
dgv1.DataSource = ds
dgv1.DataMember = "Authors"
End Sub

Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button2.Click
ds.WriteXml("C: \DevVS2005\XML_ Test\XML_Test\X MLFile1.xml")
End Sub
End Class

Typical data:
<Authors_Tabl e>
<authors>
<au_id>172-32-1176</au_id>
<au_lname>Blu e</au_lname>
<au_fname>Johns on</au_fname>
<phone>408 496-7223</phone>
<address>1093 2 Bigge Rd.</address>
<city>Menlo Park</city>
<state>CA</state>
<zip>94025</zip>
<contract>tru e</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
2473
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 last year we got traffic of between 2000 - 2500 unique visitors per day. We are now about to re-launch the site from Sweden and we need to purchase a script to run it. Having looked at what is available on the net I have realised that we need a...
7
4392
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 few features that you'd expect in any editor, except nearly none of them seem to have: 1 - Search and repalce with Regular Expressions. 2 - Search and Replace in an Xpath context. 3 - User specified tag-generation for either on a...
15
3687
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 cumbersome to always include std. I somewhere found a trick to overcome this problem. By using using std::cout;
9
2939
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 a device. The definition of the table is as follows: CREATE TABLE devicedata ( device_id int NOT NULL REFERENCES devices(id), -- id in the device
3
2641
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 you need more detail I can be glad to prove all my points. Our goal is to make logical systems. We don't want php,perl, or c++ making all the procedure calls and having the host language to be checking for errors and handleing all the...
3
10671
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 that are hard to find. The main problem I am having right now is that I have a report that is sorted by one of these lookup fields and it only displays the record's ID number. When I add the source table to the query it makes several records...
4
7404
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 there are multiple pages per invoice. How can I grab the data, make the TIF, place it on the client and then Open with the clients default program for veiwing TIF's (usually Microsoft Picture and Fax Viewer). Please help.
8
1848
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 need to build multiple mixed mode dll's used by a consumer application, do I have to implement multiple ManagedWrapper's (each embedded in indiviudal DLL project) and call all of them in my consumer application?
2
1954
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 valid IP Address", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Hand) txtIPAddress.Focus() Return End If
0
3967
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 Inbox Reply from Craig Somerford <uscos@2barter.net> hide details 10:25 pm (3 minutes ago)
0
10504
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10274
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10251
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
10033
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
7576
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
6811
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
5469
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...
0
5606
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2945
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.