Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Storing value to property array
Message
De
21/07/2011 05:37:52
 
 
À
21/07/2011 05:19:49
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Application:
Desktop
Divers
Thread ID:
01518733
Message ID:
01518734
Vues:
49
>I am trying to upload some data to a WebService, I need to create an instance of an object and set it's properties.
>
>The parent object has a .message property which is a one dimensional array of MessageObjects. I have successfully created my MessageObject but can't find out how to store it into the .message array I thought it should be ;
>
>ParentObject.message(0) = New MessageObjectClass
>ParentObject.message(0) = myBuiltMessage
>
>But I get an error that ParentObject.Message(0) is "Object reference not set to an instance of an object."
>
>Somehow I need to dimension the message() array or in some way instantiate an element, I am new to .Net and not dealt with property arrays before, how can I do this?

Are you dimensioning the array. This should work:
Dim Message As MessageObjectClass() = New MessageObjectClass(5)
Message(0) = New MessageObjectClass
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform