Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem converting C# example into VB.NET equivalent
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Problem converting C# example into VB.NET equivalent
Divers
Thread ID:
01046878
Message ID:
01046878
Vues:
64
Can anyone take a stab at turning this C# example into the VB.NET equivalent code. It's quite simple I'm sure. I just moved, can't find which box I put all of my reference books into and the Visual Studio help just isn't too helpful to me at this hour.
request.item = new Item[1];
Item item = new Item();
item.id = "0";
item.unitPrice = "29.95";
request.item[0] = item;
I thought the following would work just fine but I keep getting the error message: 'Object reference not set to an instance of an object' when the last line of the following code block executes. It's apparent I don't understand arrays in VB/C# very well.
Me.oItem = New Item
Me.oItem.id = CType(Session("liItemID"), String)
Me.oItem.unitPrice = CType(Session("liItemAmount"), Decimal)
Me.oItem.quantity = 1
'The code above works fine ... the error occurs when I try 
'the following.
Me.oRequest.item(0) = Me.oItem
Help please.

Thanks,

CTBlankenship
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform