• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 187
  • Last Modified:

Multi Dimensional Array.

Please help me,

I need to create an array or some sort of in-memory storage to:

Store a:    Number of channels(1-20)
Each channel can have multiple lines of data.
This data must be split into its relative fields.

Public gSMDRArr As String()()()         '(Ch#)(Line)(Field)

This seems a bit redundant, for example if channel(Ch#) 17 has 3 (Line)s of data each (Line) has (Field)s: "ID,Date,Time,Duration"

Line 1 for CH# 17
gSMDRArr(17)(0)(0) = "453"                       'ID
gSMDRArr(17)(0)(1) = "11/17/06"               'Date
gSMDRArr(17)(0)(2) = "02:38PM"                'Time
gSMDRArr(17)(0)(3) = "00:02:14"               'Duration
Line 2 for CH# 17
gSMDRArr(17)(1)(0) = "453"                       'ID
gSMDRArr(17)(1)(1) = "11/17/06"               'Date
gSMDRArr(17)(1)(2) = "02:40PM"                'Time
gSMDRArr(17)(1)(3) = "00:01:04"               'Duration
Line 3 for CH# 17
gSMDRArr(17)(2)(0) = "453"                       'ID
gSMDRArr(17)(2)(1) = "11/17/06"               'Date
gSMDRArr(17)(2)(2) = "02:42PM"                'Time
gSMDRArr(17)(2)(3) = "00:02:14"               'Duration

Then for channel 4 has 2 lines  then once the last line comes with its termination code i need to clear the channel, all the lines and fields.

I hope i was clear,
1 Solution
Hi ryankahan,

Why not use a  DataSet ?

As you tell, "This seems a bit redundant".

Hope this  helps.
Bob LearnedCommented:
What .NET version do you have?

Mike TomlinsonMiddle School Assistant TeacherCommented:
I would create a Class to hold the fields, and then use an ArrayList to hold multiple instances of that class...one for each line.
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Bob LearnedCommented:
Yeah, Mikey, but 2005 has generics, which is much better than an ArrayList ;)

Mike TomlinsonMiddle School Assistant TeacherCommented:
True...just depends on what flava we're workin with.  =)

How ya been Bob?...haven't seen as much of ya lately.
ryankahanAuthor Commented:
vb.net 2005.
Bob LearnedCommented:
Simplified version:

Public Class Entry

   Public ID As Integer
   Public Date_Time As Date
   Public Duration As TimeSpan

End Class

Public Class Lines

    Public Entries As New List Of(Entry)

End Class

Private m_channels As New List(Of Lines)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now