473,320 Members | 1,839 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.

help collections

In VB 6 I created a class module w/ 3 attributes that held transaction data,
such as; Trans Name, Amount, Date. I then added all of the transactions
(lines) to a collection, so I ended up with the following collection:

Trans1, Amount1, Date 1
Trans2, Amount2, Date2
Trans3, Amount3, Date 3
Trans4, Amount4, Date4
etc.........

I was then able to loop through the collection and access line and also each
element. My questions is how can I do this in vb.net. Any advice would be
great. Is there a better way?

Nov 21 '05 #1
3 930
Lee,

For most people active in this newsgroup VB6 is a long time back or they
never used it.

So please tell your problem and not how you did it in VB6, Pascal, Cobol,
FoxPro, Access or whatever.

When you have upgrade problems than there is the special newsgroup.

microsoft.public.dotnet.languages.vb.upgrade

However when you use collections, it is better not to use the
Microsoft.VisualBasic collection, which is the only one with the at one
starting indexer.

There are better ones, but please explain your problem then.

Cor

"Lee Lebrada" <ki****@excite.com>
..
In VB 6 I created a class module w/ 3 attributes that held transaction
data,
such as; Trans Name, Amount, Date. I then added all of the transactions
(lines) to a collection, so I ended up with the following collection:

Trans1, Amount1, Date 1
Trans2, Amount2, Date2
Trans3, Amount3, Date 3
Trans4, Amount4, Date4
etc.........

I was then able to loop through the collection and access line and also
each
element. My questions is how can I do this in vb.net. Any advice would be
great. Is there a better way?

Nov 21 '05 #2

"Lee Lebrada" <ki****@excite.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
In VB 6 I created a class module w/ 3 attributes that held transaction
data,
such as; Trans Name, Amount, Date. I then added all of the transactions
(lines) to a collection,


You can do a similar thing in VB.NET. First, create your class. Then add
objects of that class to an ArrayList:

Dim yourobj As yourclass
Dim MyColl As ArrayList = New ArrayList

MyColl.Add(yourobj)

Then you can iterate through the collection with:

For Each yourobj In MyColl

' do something with yourobj

Next
Tim
..NET pros and cons
http://www.itwriting.com/phorum/list.php?f=6
Nov 21 '05 #3
Thanks, Tim. I appreciate your help, unlike the other gentleman you are
willing to help us newbie's.
God Bless you.

Lee

"Tim Anderson" <ti*****@hotmail.com> wrote in message
news:uO**************@TK2MSFTNGP12.phx.gbl...

"Lee Lebrada" <ki****@excite.com> wrote in message
news:%2******************@TK2MSFTNGP15.phx.gbl...
In VB 6 I created a class module w/ 3 attributes that held transaction
data,
such as; Trans Name, Amount, Date. I then added all of the transactions
(lines) to a collection,


You can do a similar thing in VB.NET. First, create your class. Then add
objects of that class to an ArrayList:

Dim yourobj As yourclass
Dim MyColl As ArrayList = New ArrayList

MyColl.Add(yourobj)

Then you can iterate through the collection with:

For Each yourobj In MyColl

' do something with yourobj

Next
Tim
.NET pros and cons
http://www.itwriting.com/phorum/list.php?f=6

Nov 21 '05 #4

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

Similar topics

4
by: almurph | last post by:
Hi, Hope I have the right forum here - apologies if I don't. I'm trying to access a ArrayList collection via an indexer inside a class called "collExample" What I want to be able to do is to...
1
by: Michael Gorbach | last post by:
Iv got a StatisticsContainer object that contains an arraylist of objects of different types, all inherited from class Statistic. The statistics class has 2 string public properties, name and...
2
by: Eric Sykes | last post by:
After installing VSNet for several reasons I had to restore the system to before the VSNet installation. I reinstalled VSNet no problem but now when I open up VSNet a message pops up saying "Help...
5
by: ukjock | last post by:
Hi guys and Gals I need some serious help please. I can not get my head around this problem. At work we have a BBC Acorn computer (yep, I know what yer thinking), and for the past month I have...
3
by: dan heskett | last post by:
Hello group, I am trying to get used to vb.net coming from a far far far away set of tools. What i want to do is setup an object in my application that contains other object types, that act...
6
by: lennon1 | last post by:
Hi, I have already started learning .NET and I have a question. If I want to do anything - Display Data, Navigate, Update - with database (SQL Server) in Visual Studio 2005, do I have to use all...
5
by: Learner | last post by:
Hello, Here is the code snippet I got strucked at. I am unable to convert the below line of code to its equavalent vb.net code. could some one please help me with this? static public...
4
by: Ganesh Muthuvelu | last post by:
Hello, What is wrong with this template below?. I get this error: "Class 'MyEditFormTemplate' must implement 'Function ExtractValues(container As Control) As...
8
by: julia_beresford | last post by:
Hi I need to create the following class at runtime: public class MyCollection : CollectionBase { public void Add(MyItem item) { List.Add(item); }
2
by: alireza6485 | last post by:
Hi, Can you please help me with my assignment.I coded it and it runs I just need someone to help me a bit. The behaviour of monekys and human beings are Similar (Breeding and breathing are...
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...
1
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: 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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.