Newbie Question

D

Dan

I know this is better suited for a database, but I've been trying to do it
without just to see if I can-and so far I CAN'T!!

I want to save customer/vendor information where the name of the
customer/vendor is saved in an object, and that object is dumped into an
ArrayList(so that it can dynamically grow/shrink). That has worked just
fine. The problem comes when I try to save the customer's past orders.
I've been trying to store the details of these orders(the name of ordered
item and it's cost) in another ArrayList and then boxing it as an object
which is received by the constructor of the Customer class.

But when I try to display the various customers in, say a dropdownlist, I
can't get the order details of said customer to materialize in the datagrid
where I want them. Is it because it's just too nested(the order details
ArrayList)?

Basically, it looks like one of those russian dolls where there's a bunch of
little dolls inside of the bigger ones. And I'm seriously beginning to lose
my mind! I'm about to give up and resort to a database to take care of the
data, but I know this can be done---somehow---I'm just too wet behind the
ears to see it yet. Anyone have any idea? Am I on the right path here?

I'd post some code examples but I deleted them all in frustration. Hope you
guys can help.
 
P

Pohihihi

Dan,

I guess you are making it complex by doing lots of boxing (russian dolls in
your words). It will be much easy to give you solution if you can post some
code.

thanks,
Po
 
B

Bob Powell [MVP]

I would strongly suggest that you stop trying to re-invent a database and
just use a database.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
B

Bob Powell [MVP]

Although, for the sake of the original question you could store things
associated with a particular customer in a hashtable using some unique
identifier from the customer records as the key.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top