473,320 Members | 1,977 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,320 software developers and data experts.

Still Lost - Collections

Ok I am absolutely making this harder than it has to be.

I have a collection of boxes. Each box only has 3 parameters:Boxtype, BoxTare, BoxDescription.
I am loading the collection from a database using the following code:

Me.Clear()
Dim db As dal.Database = Nothing
db = dal.DatabaseFactory.CreateDatabase(location)

Dim reader As IDataReader
Dim commandtext As String = "Select * from boxes"
reader = db.ExecuteReader(CommandType.Text, commandtext)

While reader.Read
Dim bx As New Boxes.Box

bx.BoxType = reader("BoxType")
bx.BoxTare = reader("BoxTare")
bx.BoxDescription = reader("BoxDescription")

Me.add(bx)
bx = Nothing
End While
reader.Close()

That all works beautifully. I have the collection bound to a listbox and the Boxtype values show up beautifully.

I have 3 textboxes that are bound to each property of the the current box. So when I change to a new box the text boxes change with me. This is where things get clear as mud.
I want to update the values of the changed textboxes on a move to a new box. In order to do this I need to trap the original values before they are changed, and compare them with the changed values. This is where I am getting stuck, I need to keep an original value and the updated value and I am getting confused by running around in circles...Do I need to duplicate my whole collection at program start then run from there? That makes sense to me but I dont know that its the correct way to do it. Whats the point of the box class? Is it just a definition of the types in the boxcolection that I need to work with? OR am I supposed to work with the box item directly and have it update the collection? That would require databinding the textboxes to a new box item everytime i change to a new box, that seems innefficient.


--Eric Cathell, MCSA
Nov 21 '05 #1
0 670

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

Similar topics

11
by: BoonHead, The Lost Philosopher | last post by:
I think the .NET framework is great! It's nice, clean and logical; in contradiction to the old Microsoft. It only saddens me that the new Microsoft still doesn't under stand there own...
2
by: njp | last post by:
BlankHi, How do I create a tightly coupled Object 1 such that when I update it in one collection, it is simultaneously and automatically updated in other collections? The collections are defined...
2
by: LJ Jurkovic | last post by:
Has anybody encountered a situation like this: Inside Page1.aspx I'm using Server.Transfer("Page2.aspx") to get to Page2.aspx. I save few values in Context.Items which I try to restore in Page2....
5
by: Simon | last post by:
Hi all, I am writing a windows application using vb.net on the 1.1 framework. We have in the application, some strongly typed collections that have been written as classes that do not inherit...
4
by: nhmark64 | last post by:
Hi, Does System.Collections.Generic.Queue not have a Synchronized method because it is already in effect synchronized, or is the Synchronized functionality missing from...
4
by: Adam Clauss | last post by:
I ran into a problem a while back when attempting to convert existing .NET 1.1 based code to .NET 2.0 using Generic collections rather than Hashtable, ArrayList, etc. I ran into an issue because...
1
by: Paul | last post by:
Hi all, I have a very simple user control that contains 3 drop downs. Whenever there's a postback the values of these drop downs are lost. I've tried enabling viewstate everywhere without...
2
by: Fred Heida | last post by:
Hi, i'm trying to (using managed C++) implment the IEnumerable<Tinterface on my class.. but have a problem with the 2 GetEnumerator method required.... what i have done is... ...
20
by: luqman | last post by:
If user login with the login control in ASP.Net 2005 and then just close the browser and then open the browser again, the login status shows, User still Login? Any idea, how to Logout the User...
4
by: Sid Price | last post by:
Hello, I have a class of objects (Device) that are managed by another object (Devices) with a collection class (DeviceCollection) inherited from Collections.Hashtable. Each of the Device objects...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.