Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > .NET 1.0 and Visual Studio.NET > VS.NET 2002/2003
|
VS.NET 2002/2003 Discussions about the Visual Studio.NET programming environment, the 2002 (1.0) and 2003 (1.1). ** Please don't post code questions here ** For issues specific to a particular language in .NET, please see the other forum categories.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VS.NET 2002/2003 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 July 10th, 2003, 08:14 AM
Registered User
 
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default can collection object holds another arrar

hi

can a object in a collection can store a another collection object ie: arraylist, each object in collection store data of seperate array list


Dim col(5) As Collection
Dim arr as new ArrayList()

form Load event
Dim test As New ArrayList()
'adding 5 object as in "col" collection
        test.Add(100)
        Dim i As Integer
        For i = 1 To 5
            col.Add(CType(test, ArrayList), CStr(i))
        Next


ButtonClick Event
 Dim Temp As New ArrayList()
 Dim Index As Integer
 Index = Val(TextBox1.Text)

' Assigning to particular object in collection into temp arraylist to add new value

 Temp = col.Item(CStr(Index))
 Temp.Add(Val(TextBox2.Text))

'remove the particular object from col(collection) which does not contain added value

 col.Remove(CStr(Index))

adding new temp arraylist as object in "col"(collection)
 col.Add(Temp, CStr(Index))

but the added value is added in all "col" (collection) object

can collcetion object hold other collection




Luv
PurpleHaze





Similar Threads
Thread Thread Starter Forum Replies Last Post
DoDragDrop holds system Koeno Pro Visual Basic 2005 5 August 31st, 2008 04:33 PM
Return Collection object from a Web Method raybo .NET Web Services 2 June 17th, 2006 07:42 AM
VB Collection object Vs Disconnected Recordset Andypat Pro VB Databases 1 February 15th, 2005 06:57 PM
what data type in vb.net holds more thab 256 bits Hisham VB.NET 2002/2003 Basics 1 November 8th, 2004 05:35 AM
Object is not a collection?! Ashleek007 Classic ASP Basics 8 January 26th, 2004 08:07 PM





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