473,670 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Zooming Out: The Larger Issue (A Question for Experts)

The more questions I ask, the more likely I'll ask the right one and someone
will answer it, right?

Here's the big picture on my project: I'm writing a program that will keep
track of, among other things, paper inventory. I want there to be a master
list of available paper colors on a form that users can choose from, each
one having a name and a color box. The colors would be grouped into
categories; i.e. brands etc. I also want there to be a way for users to add
and delete colors and groups from the master list. I therefore envisioned
having a simple XML file with the paper colors stored in it that the program
referenced each time it wanted to build this control. The XML file would
have the general structure:

<AllPaperColors >
<PaperColorSe t name="Pastels">
<PaperColor color="ff928a" name="Cherry"></PaperColor>
<PaperColor color="ad4325" name="Azure"></PaperColor>
<PaperColor color="423441" name="Orchid"></PaperColor>
<PaperColor color="000997" name="Peach"></PaperColor>
</PaperColorSet>
<PaperColorSe t name="Astrobrig hts">
<PaperColor color="aaeeff" name="Ice"></PaperColor>
<PaperColor color="ff0099" name="Magenta"> </PaperColor>
<PaperColor color="ff5600" name="Chartreus e"></PaperColor>
<PaperColor color="0099ff" name="Aqua"></PaperColor>
</PaperColorSet>
</AllPaperColors>

This XML file seemed like the most elegant and supremely simple of all
possible solutions... quite aside from the fact that I don't know what SQL
Server is, and it sounds like it costs money, extra hardware, and months to
learn, none of which I am willing to invest at this point.

Not knowing at all how to approach reading a file structured like this, I
decided to use a DataSet object... it allows both reading and writing in
non-sequential order. I wrote an XML schema to match the above file and
applied it to the DataSet, even though it seemed to work ok without doing
so. I still don't know what the benefit of that was, other than that now I
can click "Validate XML" and no errors come up.

Now I'm having problems accessing nested elements in the bizarre structure
of the DataSet object. I don't know what properties and methods to use to
get it to do what I want. Several of them have similar descriptions that I
can't tell apart. For example, I notice that there is a Tables collection,
but there is also a PaperColorSet property. What the heck is that? Which one
contains the data? And the Rows collection... what's the difference between
Rows(0) and Rows.Item(0)? Why does neither one have a ToString property? I
have a lot of questions like that. Add that to the nested tables confusion I
already mentioned in a previous post.

So my question to you genius VB developers out there is this: have I taken a
bizarre or non-standard approach to a really simple problem? Is there any
step in the process I described above (including the structure of the XML
file, or the choice to use XML at all) that is unquestionably inferior? I'm
groping in the dark, and every tiny step is a bloody battle.

If I have done ok so far, are there any resources I could read now to learn
what tables really are? And how XML elements containing attributes, content,
and other elements are translated into tables, rows, and columns? It's an
odd way for me to conceptualize representing such simple data, and the
graphical XML designer is only adding to my confusion at this point. Not too
much longer, and I may go off the deep end and try to write an XML parser
from the ground up -- one I can understand!

Any thoughtful help is much appreciated.

Apr 1 '07 #1
4 1088

Well i personally would have chosen a different aproach

I would have set up a dataset with the desired interface with the dataset
designer , and then bind my controls to this dataset

Then you can add colors with the bound controls and save the dataset to a
XML file or a binary file ( smaller and faster to serialize deserialize ,
however you can`t add items then with notepad )

On startup of your app you could just check if the xml / binary file exists
and if so desiaralize it to a dataset object and rebind it to your controls

The above requires verry few coding ( it is 80% draging and dropping )

you may also choose to do it all from code
to get you started with this
http://www.startvbdotnet.com/ado/datatable.aspx
dataset = the container of one or more datatables

datatable = the container of one or more datarows

datarow = the container of one or more datacolumns wich in there turn hold
the values ( it ends there :-)

so in simplified XML it looks like this

1 dataset with 1 datable 1 datarow and 1 datacolumn

<dataset>
<datatable>
<datarow>
<datacolumn>
this is the value of colun 1
</datacolumn>
</datarow>
</datatable>
</dataset>
So if you refer in code to datatable(0) you get all items that are nested in
the first datatable object even so with the rows and columns

This represents a pseudo dataset with 1 datatable , 2 datarows and 3 data
columns

<dataset>
<datatable>
<datarow>
<datacolumn>
1
</datacolumn>
<datacolumn>
2
</datacolumn>
<datacolumn>
3
</datacolumn>
</datarow>
<datarow>
<datacolumn>
4
</datacolumn>
<datacolumn>
5
</datacolumn>
<datacolumn>
6
</datacolumn>
</datarow>
</datatable>
</dataset>

If you want a good reference about datasets i would recomend you one of the
ADO.Net books of MS press (i own the advanced topics book wich is verry
good )

regards

Michel Posseth [MCP]


"Peter" <st*****@hotmai l.comschreef in bericht
news:c1******** ***********@new sread1.news.pas .earthlink.net. ..
The more questions I ask, the more likely I'll ask the right one and
someone will answer it, right?

Here's the big picture on my project: I'm writing a program that will keep
track of, among other things, paper inventory. I want there to be a master
list of available paper colors on a form that users can choose from, each
one having a name and a color box. The colors would be grouped into
categories; i.e. brands etc. I also want there to be a way for users to
add and delete colors and groups from the master list. I therefore
envisioned having a simple XML file with the paper colors stored in it
that the program referenced each time it wanted to build this control. The
XML file would have the general structure:

<AllPaperColors >
<PaperColorSe t name="Pastels">
<PaperColor color="ff928a" name="Cherry"></PaperColor>
<PaperColor color="ad4325" name="Azure"></PaperColor>
<PaperColor color="423441" name="Orchid"></PaperColor>
<PaperColor color="000997" name="Peach"></PaperColor>
</PaperColorSet>
<PaperColorSe t name="Astrobrig hts">
<PaperColor color="aaeeff" name="Ice"></PaperColor>
<PaperColor color="ff0099" name="Magenta"> </PaperColor>
<PaperColor color="ff5600" name="Chartreus e"></PaperColor>
<PaperColor color="0099ff" name="Aqua"></PaperColor>
</PaperColorSet>
</AllPaperColors>

This XML file seemed like the most elegant and supremely simple of all
possible solutions... quite aside from the fact that I don't know what SQL
Server is, and it sounds like it costs money, extra hardware, and months
to learn, none of which I am willing to invest at this point.

Not knowing at all how to approach reading a file structured like this, I
decided to use a DataSet object... it allows both reading and writing in
non-sequential order. I wrote an XML schema to match the above file and
applied it to the DataSet, even though it seemed to work ok without doing
so. I still don't know what the benefit of that was, other than that now I
can click "Validate XML" and no errors come up.

Now I'm having problems accessing nested elements in the bizarre structure
of the DataSet object. I don't know what properties and methods to use to
get it to do what I want. Several of them have similar descriptions that I
can't tell apart. For example, I notice that there is a Tables collection,
but there is also a PaperColorSet property. What the heck is that? Which
one contains the data? And the Rows collection... what's the difference
between Rows(0) and Rows.Item(0)? Why does neither one have a ToString
property? I have a lot of questions like that. Add that to the nested
tables confusion I already mentioned in a previous post.

So my question to you genius VB developers out there is this: have I taken
a bizarre or non-standard approach to a really simple problem? Is there
any step in the process I described above (including the structure of the
XML file, or the choice to use XML at all) that is unquestionably
inferior? I'm groping in the dark, and every tiny step is a bloody battle.

If I have done ok so far, are there any resources I could read now to
learn what tables really are? And how XML elements containing attributes,
content, and other elements are translated into tables, rows, and columns?
It's an odd way for me to conceptualize representing such simple data, and
the graphical XML designer is only adding to my confusion at this point.
Not too much longer, and I may go off the deep end and try to write an XML
parser from the ground up -- one I can understand!

Any thoughtful help is much appreciated.

Apr 1 '07 #2


http://sholliday.spaces.live.com/blog/
If you're starting from scratch, then I'd create a strongly typed dataset
first.
This will make life easier on you.
Your xml below isn't bad, but its not as "dataset-ish" as it ought to be.

After you create a strong dataset, you can manually add rows to you.

Then you can do a myDS.Write( @"C:\myfile.xml ") and see the output.

This is a better direction of approach then the other way.
5/24/2006
Custom Objects/Collections and Tiered Development
If you download my example, you can do something like this:
CustomerOrderIn foDSNoConstrain tsDS myds = new
CustomerOrderIn foDSNoConstrain tsDS();

myds.Customer.A ddNewCustomerRo w ( "111" , "John" , "Boise" ) ;
myds.Customer.A ddNewCustomerRo w ( "222" , "Mary" , "Winchester ");

myds.Order.AddN ewOrderRow( 1001 , "111" , DateTime.Now , DateTime.Now ,
1.00 ) ; //you may have to adjust a little
myds.Order.AddN ewOrderRow( 2002 , "222" , DateTime.Now , DateTime.Now ,
2.00 ) ;//you may have to adjust a little

myds.Write ( @"C:\myfirststr ongdsfile.xml" ) ;
That should get you going.

DataSet xml is largely ~element based. Your xml above is largely ~attribute
based.

Doing the above example will show you the difference.



"Peter" <st*****@hotmai l.comwrote in message
news:c1******** ***********@new sread1.news.pas .earthlink.net. ..
The more questions I ask, the more likely I'll ask the right one and
someone
will answer it, right?

Here's the big picture on my project: I'm writing a program that will keep
track of, among other things, paper inventory. I want there to be a master
list of available paper colors on a form that users can choose from, each
one having a name and a color box. The colors would be grouped into
categories; i.e. brands etc. I also want there to be a way for users to
add
and delete colors and groups from the master list. I therefore envisioned
having a simple XML file with the paper colors stored in it that the
program
referenced each time it wanted to build this control. The XML file would
have the general structure:

<AllPaperColors >
<PaperColorSe t name="Pastels">
<PaperColor color="ff928a" name="Cherry"></PaperColor>
<PaperColor color="ad4325" name="Azure"></PaperColor>
<PaperColor color="423441" name="Orchid"></PaperColor>
<PaperColor color="000997" name="Peach"></PaperColor>
</PaperColorSet>
<PaperColorSe t name="Astrobrig hts">
<PaperColor color="aaeeff" name="Ice"></PaperColor>
<PaperColor color="ff0099" name="Magenta"> </PaperColor>
<PaperColor color="ff5600" name="Chartreus e"></PaperColor>
<PaperColor color="0099ff" name="Aqua"></PaperColor>
</PaperColorSet>
</AllPaperColors>

This XML file seemed like the most elegant and supremely simple of all
possible solutions... quite aside from the fact that I don't know what SQL
Server is, and it sounds like it costs money, extra hardware, and months
to
learn, none of which I am willing to invest at this point.

Not knowing at all how to approach reading a file structured like this, I
decided to use a DataSet object... it allows both reading and writing in
non-sequential order. I wrote an XML schema to match the above file and
applied it to the DataSet, even though it seemed to work ok without doing
so. I still don't know what the benefit of that was, other than that now I
can click "Validate XML" and no errors come up.

Now I'm having problems accessing nested elements in the bizarre structure
of the DataSet object. I don't know what properties and methods to use to
get it to do what I want. Several of them have similar descriptions that I
can't tell apart. For example, I notice that there is a Tables collection,
but there is also a PaperColorSet property. What the heck is that? Which
one
contains the data? And the Rows collection... what's the difference
between
Rows(0) and Rows.Item(0)? Why does neither one have a ToString property? I
have a lot of questions like that. Add that to the nested tables confusion
I
already mentioned in a previous post.

So my question to you genius VB developers out there is this: have I taken
a
bizarre or non-standard approach to a really simple problem? Is there any
step in the process I described above (including the structure of the XML
file, or the choice to use XML at all) that is unquestionably inferior?
I'm
groping in the dark, and every tiny step is a bloody battle.

If I have done ok so far, are there any resources I could read now to
learn
what tables really are? And how XML elements containing attributes,
content,
and other elements are translated into tables, rows, and columns? It's an
odd way for me to conceptualize representing such simple data, and the
graphical XML designer is only adding to my confusion at this point. Not
too
much longer, and I may go off the deep end and try to write an XML parser
from the ground up -- one I can understand!

Any thoughtful help is much appreciated.

Apr 2 '07 #3
Well i personally would have chosen a different aproach
>
I would have set up a dataset with the desired interface with the dataset
designer , and then bind my controls to this dataset

Then you can add colors with the bound controls and save the dataset to a
XML file or a binary file ( smaller and faster to serialize deserialize ,
however you can`t add items then with notepad )

On startup of your app you could just check if the xml / binary file
exists and if so desiaralize it to a dataset object and rebind it to your
controls
Thank you for the idea. I think I am going to try to pursue a course of
action similar to this.

Apr 3 '07 #4
If you're starting from scratch, then I'd create a strongly typed dataset
first.
This will make life easier on you.
Your xml below isn't bad, but its not as "dataset-ish" as it ought to be.
....
DataSet xml is largely ~element based. Your xml above is largely
~attribute
based.
Thank you for the distinction. I designed the XML structure by hand before
going into VB, doing what seemed to make the most sense semantically... i.e.
the Name of a PaperColor element seemed more like an attribute than a child
element... but you're right; it makes the dataset a lot more cryptic to work
with. Thanks for the help.

Apr 3 '07 #5

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

Similar topics

7
3291
by: George Hester | last post by:
Please take a look at this google artcle: http://groups.google.com/groups?hl=en&lr=&frame=right&th=55d6f4b50f5f9382&seekm=411f370d%241%40olaf.komtel.net#link9 The op was having trouble with access denied using resizeTo. I am having the same issue but the explanations in this article don't seem to apply here. I am not trying to resize a window with content from a different server. This issue lies here. What I do is make a popup...
0
1520
by: Gopi | last post by:
Hi All I have set a BackgroundImage for windows forms and i need to implement the image zooming feature for the form ie when ever i m zooming in or zooming out the form the corrosponding background image also needs to be zoomed in and zoomed out. the zoom factors ( zooming values are) 50%,100% and 150% how do i implement this? thanks in advance Gopi
4
2607
by: Andy | last post by:
I created a Windows application that is having an odd issue. The application starts for a split second, but then closes. I cannot get any error messages to display as to what causes the program to close. Listed below is my Default_Load method. How would I be able to trap the error so I know what is causing this form to not load as I do not get any information at this time. We have it running on 4 different computers, but the one...
0
1804
by: pavanjosh | last post by:
Hello Frineds, Can anyone please help me in getting the code or library for written in C# for zooming in and zooming out the images in the picture box? Or is there any other way from which i can achieve the same task? Your help will be gretely appreciated. Thanks and Reagrds Pavan Joshi
4
2663
by: tkirankumar | last post by:
Hi all, This is regarding the issue I am facing while porting the my application from SuSe Linux to Sun Solaris. The Existing system details: Itanium boxes 1mhz 4 processor 8 gb machines with SuSe Linux $ uname -a Linux longrtedged01 2.4.21-215-itanium2-smp #1 SMP Mon Apr 26 16:28:29
1
3015
by: Rathorevivek | last post by:
Hi All, I have been using full text search in my application for search purpose. But on certain words i.e Noise Words such as And,After,About etc. I am receiving the following error: Execution of a full-text operation failed. A clause of the query contained only ignored words. I tried a lot to sort out this issue,but this is going to be out of my scope. If anybody can help me then it would be really appreciable.
2
1966
by: Steve K. | last post by:
I am in over my head I think, I've got my brain running in circles trying to figure this out. I'm using remoting with a client and a server. I need the server to raise events on the client and after doing quite a bit of reading I found what I think is the correct way. The article I read encourages shims to pass the delegate to server and back so that the client process doesn't need to be passed. I barely understand it, I will...
11
4355
by: blunt | last post by:
trying to write a program to write the configuration files for a load of wireless access points. i've never been a good programmer and haven't done any for nearly a decade so have obviously made some mistakes, i'm using cygwin on a windows pc and it seems that some functions cause stack overflows so am using fgets instead of fgetc (don't know y it solved the problem but that part is working). my problem now is that i am reading strings a few...
0
8466
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
8384
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
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
8813
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...
0
8659
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
7412
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
6212
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
4388
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
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

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.