Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default Best way?

    I have a Web service that I'm developing that I'm trying to make as
    easy as possible to use.

    In my main app (which won't be using the service), I have an account
    object class, which in turn has a collection of a business object
    class. This is how I'm keeping the appropriate businesses with the
    correct user account.

    I've been trying to accomplish this in the Web services, but I'm not
    having very good luck. I was able to serialize the collection, but in
    order to add a business to it I have to ReDim and Preserve the business
    collection: ReDim Preserve account.BusinessCollection(1)
    account.BusinessCollection(1) = New MyService.Business

    Is there a better way?

    The client app needs to read, modify, add the account and business
    objects.

    Greg -- Guest

  2. #2

    Default Re: Best way?

    How about using a different collection class? - an ArrayList will
    automatically allocate new space for you - a Hashtable provides fast
    lookups, there are a variety of options in the System.Collections namespace.

    As long as your serialise method operates on the ICollection or IEnumerable
    interface you should be able to pick and choose the best for your own
    purposes.

    AD


    "Greg --" <metal480@gmail.com> wrote in message
    news:1122311662.729694.223780@g43g2000cwa.googlegr oups.com...
    >I have a Web service that I'm developing that I'm trying to make as
    > easy as possible to use.
    >
    > In my main app (which won't be using the service), I have an account
    > object class, which in turn has a collection of a business object
    > class. This is how I'm keeping the appropriate businesses with the
    > correct user account.
    >
    > I've been trying to accomplish this in the Web services, but I'm not
    > having very good luck. I was able to serialize the collection, but in
    > order to add a business to it I have to ReDim and Preserve the business
    > collection: ReDim Preserve account.BusinessCollection(1)
    > account.BusinessCollection(1) = New MyService.Business
    >
    > Is there a better way?
    >
    > The client app needs to read, modify, add the account and business
    > objects.
    >


    Posted Via Usenet.com Premium Usenet Newsgroup Services
    ----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
    ----------------------------------------------------------
    [url]http://www.usenet.com[/url]
    adbarnet Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139