473,386 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Convert VB.Net to C# Question

Hi!

How can I convert the code below (VB.Net) to C#?

Dim c As New ArrayList
Return CType(c.ToArray(GetType(HistoryInfo)), HistoryInfo())

Where "HistoryInfo" is a common class.

Thanks,
Bruno.
Nov 21 '05 #1
2 904
This link will usually work, but in this case it was slightly incorrect as
it missed the [].
http://www.developerfusion.com/utili...btocsharp.aspx

ArrayList c = new ArrayList();
///
///I assume there's some manipulation of c happening here.
///
return ((HistoryInfo[])c.ToArray(typeof(HistoryInfo)));

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Bruno Rodrigues" <Br************@discussions.microsoft.com> wrote in
message news:E7**********************************@microsof t.com...
Hi!

How can I convert the code below (VB.Net) to C#?

Dim c As New ArrayList
Return CType(c.ToArray(GetType(HistoryInfo)), HistoryInfo())

Where "HistoryInfo" is a common class.

Thanks,
Bruno.

Nov 21 '05 #2
Thanks Mick, it's exactly what I need.
PS.: Yes, there is array manipulation between the line.

Regards,
Bruno Rodrigues.

"Mick Doherty" wrote:
This link will usually work, but in this case it was slightly incorrect as
it missed the [].
http://www.developerfusion.com/utili...btocsharp.aspx

ArrayList c = new ArrayList();
///
///I assume there's some manipulation of c happening here.
///
return ((HistoryInfo[])c.ToArray(typeof(HistoryInfo)));

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Bruno Rodrigues" <Br************@discussions.microsoft.com> wrote in
message news:E7**********************************@microsof t.com...
Hi!

How can I convert the code below (VB.Net) to C#?

Dim c As New ArrayList
Return CType(c.ToArray(GetType(HistoryInfo)), HistoryInfo())

Where "HistoryInfo" is a common class.

Thanks,
Bruno.


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below....
12
by: dixie | last post by:
Can someone familiar with Access 2003 please answer this question? I am asking because I don't have the use of A2003. When Access 2003 finds an Access 2000 database, does it come up with some...
12
by: Brian Henry | last post by:
first question... I have a flat file which unfortinuatly has columns seperated by nulls instead of spaces (a higher up company created it this way for us) is there anyway to do a readline with this...
6
by: patang | last post by:
Could someone please tell me where am I supposed to put this code. Actually my project has two forms. I created a new module and have put the following code sent by someone. All the function...
4
by: simonZ | last post by:
Why this don't work: Boolean test; String testValue; testValue="0"; test=System.Convert.ToBoolean(testValue); How can I convert string to boolean?
4
by: dba_222 | last post by:
Dear Experts, Ok, I hate to ask such a seemingly dumb question, but I've already spent far too much time on this. More that I would care to admit. In Sql server, how do I simply change a...
27
by: comp.lang.tcl | last post by:
My TCL proc, XML_GET_ALL_ELEMENT_ATTRS, is supposed to convert an XML file into a TCL list as follows: attr1 {val1} attr2 {val2} ... attrN {valN} This is the TCL code that does this: set...
1
by: johnlim20088 | last post by:
Hi, Currently I have 6 web projects located in Visual Source Safe 6.0, as usual, everytime I will open solution file located in my local computer, connected to source safe, then check out/check in...
6
by: Ken Fine | last post by:
This is a basic question. What is the difference between casting and using the Convert.ToXXX methods, from the standpoint of the compiler, in terms of performance, and in other ways? e.g. ...
0
by: deloford | last post by:
Hi This is going to be a question for anyone who is an expert in C# Text Encoding. My situation is this: I have a Sybase database which is firing back ISO-8559 encoded strings. I am unable to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.