473,503 Members | 3,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to add different datatypes to arrays/arraylists...?

Hi,
I am a developper who needs to return a collection of different
datatypes. Have considered using an array containing arraylists. Is it
posible? or is there a better way? Would like to use some kind of 2
dim arraylist, like Vectors in JAVA...

Carsten
Nov 15 '05 #1
3 1954
I'm still brand new to .NET, but fabricated ADO Recordsets worked great for
this in VB. I presume ADO.NET Recordsets are at least as useful for this
job in C#.

On 17 Oct 2003 00:21:08 -0700, ta***@mail.dk (madsen) wrote:
Hi,
I am a developper who needs to return a collection of different
datatypes. Have considered using an array containing arraylists. Is it
posible? or is there a better way? Would like to use some kind of 2
dim arraylist, like Vectors in JAVA...

Carsten


Nov 15 '05 #2
madsen <ta***@mail.dk> wrote:
I am a developper who needs to return a collection of different
datatypes. Have considered using an array containing arraylists. Is it
posible? or is there a better way? Would like to use some kind of 2
dim arraylist, like Vectors in JAVA...


An ArrayList in .NET is almost exactly like a Vector in Java. If you
could give some sample code in Java, I'd be happy to translate that to
C# for you.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3
Arrary list can handle different datatypes (it stores objects)
tried using maps ? (name value pairs).. that could help you

"madsen" <ta***@mail.dk> wrote in message
news:a3**************************@posting.google.c om...
Hi,
I am a developper who needs to return a collection of different
datatypes. Have considered using an array containing arraylists. Is it
posible? or is there a better way? Would like to use some kind of 2
dim arraylist, like Vectors in JAVA...

Carsten

Nov 15 '05 #4

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

Similar topics

0
1668
by: James | last post by:
I see that variations on this question have appeared before but I'm still completely stumped. I'm developing an application with a fairly robust graphics component for 3D rendering. I've written...
3
4620
by: Marco | last post by:
Hello there, We're new to C# and have noticed a strange behaviour which we don't yet understand. We wrote a COM DLL (in VC++ 6.0) which performs some calculation based on some double arrays...
10
5416
by: Liz - Newbie | last post by:
Does anyone know how to clear arrays? My C# books talk about creating arrays or talk about using Clear or RemoveAt but these methods don't appear to be available for my array. I have an array...
9
8383
by: David Sobey | last post by:
basic question, confused by the type system of c#: i'm making a calendar prog, with an array of days, each day being an array of events. I want something like: public struct Event { string...
9
1577
by: Steve | last post by:
Hello, I created a structure ABC and an array of type ABC Public Structure ABC Dim str1 As String Dim int1 As Integer End Structure Public ABC1 As New ABC, ABC2 As New ABC
2
4088
by: Florian G. Pflug | last post by:
Hi Since sometime yesterday, my postgresql (7.4.5) reports "ERROR: cannot compare arrays of different element types", when I analyze a specific table in my database. Here is the tables...
1
1946
by: Henri Schomäcker | last post by:
Hi folks, what I need is a kind of 2D-Array which should, in the end, represent a typical html-table and which should be sortable by column. I thought of an implementation, where an vector...
1
1758
by: Newbie19 | last post by:
I'm just learning java arrays/arraylists and was wondering what are the best books for learning java arrays/arraylists? I know practice is the best way to learn, but I have a hard time...
4
8915
by: =?Utf-8?B?SkI=?= | last post by:
Hello List<Tis said to be more powerful than ArrayLists but if you have something like this: List<intmylst = new List<>; myList.Add("Joe"); myList.Add(25); the list doesn't seem to...
0
7192
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
7064
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...
0
7261
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1492
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.