473,796 Members | 2,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3482
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********@dis cussions.micros oft.com> wrote in message
news:E5******** *************** ***********@mic rosoft.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
2574
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 order to be able to re-run some experiments at a later date I would like to store every dictionary in the same file. I looked at pickel, but that seems to require a whole file for each dictionary.
4
3034
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
3747
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 the appropriate array. For instance if I receive a RCVD_MSG1, I'll copy into msg1 . Upon receipt of the next RCVD_MSG1. I'll copy into msg1 . The Retrieve function when called should retrieve the latest copy. ie. msg1 or msg1 .
34
2452
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 to a function). Can't help but think this "utility" already exists but f**ked if I can find it.
5
2931
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 using as there are many choices to choose from. My database will contain a lot of records. TIA
5
1232
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 database. If I were to go for SQL tables, I would end up with several tables, the main one having many columns. Maintaining the stored procedures and methods involved in this would be a pain. What are some other good techniques for storing something...
3
4445
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 decided that the most effective way would be : When i connect to the server once, I download the list and disconnect, instead of connecting every time i go, to the lower node in my tree hierarhy. Thus i have a problem - how to store data.
13
2395
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 file information - page displays file information with a 'are you sure you want to delete' confirmation button. - upon clicking said button, I delete the record.
3
5069
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 did it with simple text. This time around, I want to handle much more complex text. I need to preserve some kinds of features. (Yes, I have turned off magic quotes.) - Need to strip diacritics. I learned I could use htmlentities to catch...
0
9673
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10217
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
10168
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
10003
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...
0
9047
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
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
6785
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();...
1
4114
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 we have to send another system
3
2924
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.