Solved

C# equivelant

Posted on 2004-10-06
1
217 Views
Last Modified: 2010-04-15

Assuming that companyInfo is a class i defined and added an instance of it to an ArrayList, such as
CompanyInfo x = new CompanyInfo();
ArrayList aL = new ArrayList();
//assign value to x

aL.Add(x);

How can i convert this line of VB.NET

Return CType(c.ToArray(GetType(CompanyInfo)), CompanyInfo())

To C# and get the same affect?

The return type of this function is CompanyInfo.
0
Comment
Question by:CDFA_Inc
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 250 total points
ID: 12242219
return ((CompanyInfo)c.ToArray(typeof(CompanyInfo)));

Bob
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now