Solved

VB software:  old school new school

Posted on 2013-11-13
2
238 Views
Last Modified: 2013-11-14
A number of years ago I used collections .add  . remove  .count to keep track of data.

My understanding is that collections are old school, what is the new way of inputting large amounts of data (objects)  and keeping track of each item, either adding, updating, or deleting items?
0
Comment
Question by:brianpowell
2 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 250 total points
ID: 39646623
I would not say collections are "old school". They're still very useful objects in your programming arsenal, but .NET certainly has moved the marker forward in that area. Many use the List class, which allows you to store a "list" of objects. It's used like this:

Dim obj as List (Of String)

The "Of String" could be anything, like "Of clsInvoice", if I needed a list of my "clsInvoice" objects. It's fairly simple to use a List:

Dim Customers As List(Of String)

Customers.Add("Bob")
Customers.Add("Sue")
Customers.Add("Sam")

Here's the MSDN page that defines all the Properties, Methods, etc of the List:

http://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx
0
 
LVL 10

Assisted Solution

by:joriszwaenepoel
joriszwaenepoel earned 250 total points
ID: 39647239
It depends on the scenario, sometimes a classic collection is still a good choice. But in a lot of cases there is a better alternative in the Generic collections:

http://msdn.microsoft.com/en-us/library/ms172192(v=vs.110).aspx

For example there is:
- List
- Queue
- Stack
- Dictionary
- SortedList
- SortedDictionary
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question