473,395 Members | 2,006 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,395 software developers and data experts.

Store/Retrieve data with XML - keeping it simple

I am struggling a bit with XML, even as I wade through endless help files and
several books. I thought it would be useful to toss my particular needs to
the group to see what you think is the best approach.

I have a form that is able to read/write from an embedded device with one of
several serial protocols. Through this interchange, I can read or write lots
of different settings in the target. What I want to do now is save the
settings to a file and back again. Here is what the data looks like that I
want to store to a file:

1. Device software info (several strings, "name", "version", "software part
nuber"
2. Configuration data (all binary data, no string) This C structure
contains 8 items, floats, 32-bit signed longs, and 8-bit chars. (Remember,
the target is a "C" guy)
3. Setting data (like #2 above, has lots of values)
4. Digital compensation settings for temperature adjustments (more floats,
5 of them)
5. Linearity compensation settings
....

So, there are lots of settings for each target device. Some of the settings
are determined at design time, some are unique to particular circuit board
configurations, and some are unique to each particular device.

I want to simple be able to write the settings to a file, and read them
back. One day, we may want to hook to a database (in the factory) but I will
likely leave that to the factory engineers to do that. Right now, the entire
app works except for this file reading/writing. Once again, I think I know
what I want to do and it seems simple, but I don't know how to get started.

One final thing: I have created a Schema and am squirting the data to a
file, but I'm not able to figure out how to read it back again and then tell
what I have so I know which text box to stick it into.

Thanks for your patience in reading this.
Nov 16 '05 #1
1 3450
I run into this situation frequently. I find it very simple and elegant to
use xml serialization:

1. Use the XSD tool to convert your schema into C# classes:
http://msdn.microsoft.com/library/de...nitiontool.asp
2. Use the generated classes to write read/write code:
http://msdn.microsoft.com/library/de...lizetopic2.asp

Hope this helps.

"Kenny ODell" <Ke********@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
I am struggling a bit with XML, even as I wade through endless help files
and
several books. I thought it would be useful to toss my particular needs
to
the group to see what you think is the best approach.

I have a form that is able to read/write from an embedded device with one
of
several serial protocols. Through this interchange, I can read or write
lots
of different settings in the target. What I want to do now is save the
settings to a file and back again. Here is what the data looks like
that I
want to store to a file:

1. Device software info (several strings, "name", "version", "software
part
nuber"
2. Configuration data (all binary data, no string) This C structure
contains 8 items, floats, 32-bit signed longs, and 8-bit chars.
(Remember,
the target is a "C" guy)
3. Setting data (like #2 above, has lots of values)
4. Digital compensation settings for temperature adjustments (more
floats,
5 of them)
5. Linearity compensation settings
...

So, there are lots of settings for each target device. Some of the
settings
are determined at design time, some are unique to particular circuit board
configurations, and some are unique to each particular device.

I want to simple be able to write the settings to a file, and read them
back. One day, we may want to hook to a database (in the factory) but I
will
likely leave that to the factory engineers to do that. Right now, the
entire
app works except for this file reading/writing. Once again, I think I
know
what I want to do and it seems simple, but I don't know how to get
started.

One final thing: I have created a Schema and am squirting the data to a
file, but I'm not able to figure out how to read it back again and then
tell
what I have so I know which text box to stick it into.

Thanks for your patience in reading this.

Nov 16 '05 #2

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

Similar topics

7
by: Philipp H. Mohr | last post by:
Hello, I would like to store multiple dictionaries in a file, if possible one per line. My code currently produces a new dictionary every iteration and passes it on to another peace of code. In...
4
by: jandt | last post by:
I know that you can retrieve data from a form using Request.Form("name"), but how do you retrieve a file?
2
by: forums_mp | last post by:
I've got an STL class (see below) with two functions to store and retrieve data - msg structs. The "Store" function when called will copy the received message (depending on which message) into...
34
by: kevin.watters | last post by:
Hi all, I have a need for a short program: Given a drive letter, it would recursively search through all directories, "generating" each filename that it encounters (need to pass each filename...
5
by: Roy Gourgi | last post by:
Hi, I am used to working in Visual FoxPro and I would like to be able to create a database and store and retrieve information from it. What is the simplest way to do it and what should I be...
5
by: George Durzi | last post by:
I have a company form that I need to web-enable. The form has about 50 data items with some of these data items able to have N sub data items. I'm considering ways to store this form in my...
3
by: piotrek | last post by:
Hi I would like to ask you a question. Ian creating app. that download from server directory structure ( whole tree ) and those data are placed in proper places into my treeview control. I...
13
by: darrel | last post by:
When I write scripts for deleting records in databases, I tend to do it in this fashion: - delete link passes ID to a delete.aspx page - delete.aspx page queries db using that ID to retrieve the...
3
by: Alfred | last post by:
I want to post text field data from these HTML TEXTAREA tags to a PostgreSQL database and have it reappear back on another page exactly as I had typed it. Over the years I have done this but only...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
0
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...
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...

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.