Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 7th, 2004, 06:59 AM
Authorized User
 
Join Date: Dec 2003
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to DolphinBay
Default Non-Continguous Indicies in ArrayList

Good morning,

I am trying to create an arraylist of information that contains indicies that are non-contiguous. When I get to the first non-contiguous index value an exception is being thrown. Can someone please tell me how I can go about using VB.NET to create an "arraylist" that contains non-contiguous index values. The index values correspond to unique ID's of DB records.

Example Data:
aryTest(1) = 100
aryTest(2) = 21
aryTest(4) = 86
aryTest(18) = 123

Many thanks,
Eric

Error:
Insertion index was out of range. Must be non-negative and less than or equal to size. Parameter name: index


Dolphin Bay, Inc. -- turning visions into eReality(tm) -- West Palm Beach, FL
Website Design, Internet Strategy, Search Engine Marketing

www.DolphinBay.biz
 
Old May 7th, 2004, 07:29 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

If they are non-contiguous, you're better off using a HashTable. That allows you to use the "index" as a key.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: We Walk in the Dream by Live (Track 12 from the album: The Distance to Here) What's This?
 
Old May 7th, 2004, 08:09 AM
Authorized User
 
Join Date: Dec 2003
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to DolphinBay
Default

Imar,

That did the trick. Thanks very much for the direction.


Dolphin Bay, Inc. -- turning visions into eReality(tm) -- West Palm Beach, FL
Website Design, Internet Strategy, Search Engine Marketing

www.DolphinBay.biz





Similar Threads
Thread Thread Starter Forum Replies Last Post
ArrayList Mogg-Way C# 2005 5 February 12th, 2008 04:05 PM
ArrayList Filtering SKhna ASP.NET 2.0 Basics 2 February 11th, 2008 03:30 PM
Arraylist mechanism anwarraja Pro Java 1 September 6th, 2007 11:54 AM
Help with an arraylist crazy-nun General .NET 4 July 14th, 2005 03:32 AM
ArrayList kobystud C# 4 May 25th, 2004 02:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.