473,473 Members | 1,475 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Populating an Array

I have a class that defines an array (JudgeTableEntity) which contains sets
of data (Judge) - see class below. I want to put several sets of test data
in the array but cannot find the syntax to do so? Can someone point me to
information or an example of how to do this?

Thanks

Wayne

=============== Class Definition ================
Imports System.Xml

Imports System.Xml.Serialization

Imports System.Collections

Public Class ArrayOfJudgeTableEntity

<XmlArray("JudgeTableEntity"), XmlArrayItem("Judge", IsNullable:=True)> _

Public Judges() As Judge
Public Sub New()

End Sub 'New

End Class 'ArrayOfJudgeTableEntity

Public Class Judge

Public JudgeID As String

Public JudgeFirstName As String

Public JudgeLastName As String

Public JudgeType As String

Public Sub New()

End Sub 'New

Public Sub New(ByVal id As String, ByVal fn As String, ByVal ln As String,
ByVal type As String)

JudgeID = id

JudgeType = type

JudgeFirstName = fn

JudgeLastName = ln

End Sub 'New

End Class 'Judge
Nov 21 '05 #1
1 1113
This test code appears to work. I added a new "New" constuctor to the class
to ReDim the Array. Is that the right way to do this?

' Create some sample Judges info

Dim Judge1 As New Judge("ID1", "Shirlee", "Whitcomb", "GE")

Dim Judge2 As New Judge("ID2", "Joe", "Courtney", "TaP")

Dim array2 As New ArrayOfJudgeTableEntity(2)

array2.Judges(0) = Judge1

array2.Judges(1) = Judge2

===========================================

"Wayne Wengert" <wa***************@wengert.com> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
I have a class that defines an array (JudgeTableEntity) which contains sets of data (Judge) - see class below. I want to put several sets of test data
in the array but cannot find the syntax to do so? Can someone point me to
information or an example of how to do this?

Thanks

Wayne

=============== Class Definition ================
Imports System.Xml

Imports System.Xml.Serialization

Imports System.Collections

Public Class ArrayOfJudgeTableEntity

<XmlArray("JudgeTableEntity"), XmlArrayItem("Judge", IsNullable:=True)> _

Public Judges() As Judge
Public Sub New()

End Sub 'New

End Class 'ArrayOfJudgeTableEntity

Public Class Judge

Public JudgeID As String

Public JudgeFirstName As String

Public JudgeLastName As String

Public JudgeType As String

Public Sub New()

End Sub 'New

Public Sub New(ByVal id As String, ByVal fn As String, ByVal ln As String,
ByVal type As String)

JudgeID = id

JudgeType = type

JudgeFirstName = fn

JudgeLastName = ln

End Sub 'New

End Class 'Judge

Nov 21 '05 #2

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

Similar topics

0
by: David P. Jessup | last post by:
Background info: I'm attempting to populate an array with specific column numbers from a database. I have another array(from a linked table) that has matching column names from the original...
29
by: Friday | last post by:
Sorry if this is the wrong group. I tried to find the one I thought would be most relevant. I'm an old PHP guy, who knows little about asp and NOTHING about asp.net, but need to learn at least...
6
by: Deano | last post by:
I needed to have a listbox populated by locations which are stored in tblLocations. However I wanted an "All locations" entry to be at the top of the listbox. This is not in the tblLocations. The...
4
by: Sangeetha | last post by:
I came across this array initialisation which I can't follow ---------------------------------------------- public static string AllOperators { get {
8
by: jack-b | last post by:
Hi, I have a list box which displays countries names and a second listbox which displays their cites (based on the selection made in ListBox 1) If the user selects USA i want to display cities...
1
by: Stephene | last post by:
New to the world of web design/php/mysql and need help please. What I'm trying to do: I would like a web page with three drop down menus each populated by a query The first represents...
4
by: clrockwell | last post by:
Hey all, I could use some help with solving problem. Any suggestions are welcome and very appreciated. I have two arrays, $feeds and $feedDays. If they both have the same count, or $feeds...
4
by: Peter Duniho | last post by:
On Thu, 14 Aug 2008 18:56:00 -0700, Phill <Phill@discussions.microsoft.comwrote: For future reference, if you are asking for help with an error (compile or execution), you really should post...
6
by: cathyisfrustrated | last post by:
Hey, I've been trying to learn javascript for a few days. I'm a bit stuck! I'd appreciate any links to get me going in the right direction or any advice I can get. I've written a...
0
by: jac130 | last post by:
i need to populate an array with grades. there is an 'add students & grades' button. user is prompted by input box to enter a students name, then another input box to enter their grade. the student's...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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,...
0
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
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.