How to represent an array of objects?

Discussion in 'ASP .Net Web Services' started by Mark A. Deal, Jan 11, 2005.

  1. Mark A. Deal

    Mark A. Deal Guest

    If I have the following class declaration and then need to be able to
    provide a way to access a collection of PartyRecords, how would I accomplish
    this?

    Public Class PartyRecord
    Private FLast As String
    Public Property Last() As String
    Get
    Return FLast
    End Get
    Set(ByVal FLast As String)
    End Set
    End Property
    end class

    As a Delphi convert, I can only refer to the way I used to do it:

    TParty = Array of PartyRecord;

    I have tried to figure out how to do it with Arrays and have not had much
    luck. I assume I should use collections but cannot get very far with that
    either.

    Anybody have any helpful hints?

    TIA!

    --
    Mark A. Deal
    Document & Data Solutions, LLC
    http://www.docsol.com
    Time Matters AIC
    HotDocs Certified Consultant
    GhostFill Certified Consultant
     
    Mark A. Deal, Jan 11, 2005
    #1
    1. Advertising

  2. Hello Mark,
    Add your objects to an ArrayList and use the ToArray method

    HTH
    Regards,
    Dilip Krishnan
    MCAD, MCSD.net
    dkrishnan at geniant dot com
    http://www.geniant.com

    > If I have the following class declaration and then need to be able to
    > provide a way to access a collection of PartyRecords, how would I
    > accomplish this?
    >
    > Public Class PartyRecord
    > Private FLast As String
    > Public Property Last() As String
    > Get
    > Return FLast
    > End Get
    > Set(ByVal FLast As String)
    > End Set
    > End Property
    > end class
    > As a Delphi convert, I can only refer to the way I used to do it:
    >
    > TParty = Array of PartyRecord;
    >
    > I have tried to figure out how to do it with Arrays and have not had
    > much luck. I assume I should use collections but cannot get very far
    > with that either.
    >
    > Anybody have any helpful hints?
    >
    > TIA!
    >
     
    Dilip Krishnan, Jan 11, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lezah
    Replies:
    0
    Views:
    510
    lezah
    Feb 4, 2004
  2. Alex Lee
    Replies:
    5
    Views:
    2,691
    Jeff Dunn
    May 19, 2004
  3. guoqi zheng

    Enum to represent string??

    guoqi zheng, Jun 12, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    468
    =?Utf-8?B?UmVlY2UgV2lsbGlhbXM=?=
    Jun 15, 2005
  4. 7stud
    Replies:
    11
    Views:
    756
    Dennis Lee Bieber
    Mar 20, 2007
  5. Replies:
    7
    Views:
    418
    David Lamb
    Oct 29, 2012
Loading...

Share This Page