[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

convert array of objects to ICollection

Posted on 2005-05-09
1
Medium Priority
?
652 Views
Last Modified: 2008-03-17
how can I convert an array of objects into an ICollection?

I am attempting to add an array of type Object to an ArrayList.


 Dim items(combo1.Items.Count - 1) As Object
Dim ic As ICollection
ic = CType(items, ICollection)
Dim al As New ArrayList
al.AddRange(ic)


(this is giving me an error)
0
Comment
Question by:brokeMyLegBiking
1 Comment
 
LVL 64

Accepted Solution

by:
Fernando Soto earned 2000 total points
ID: 13963428
Just do the following.

Dim al As New ArrayList
al.AddRange(Combo1.Items)

Combo1.Items is already a collection.

ICollection is an interface and all of it functionality must be programmed by you.

I hope this was of some help
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month18 days, 12 hours left to enroll

834 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