Best Way To...

Results 1 to 2 of 2

Thread: Best Way To...

  1. #1
    Join Date
    Dec 1969

    Default Best Way To...

    I&#039;m working on an ecommerce site with On the cart page, I have an array that contains one or multiple product ID&#039;s and a related quantity. I then want to display information based on EACH of the prodID&#039;s. This info will be product name, description and price.<BR><BR>My question is, what type of object could I put this information in to? I am confused because I am going to have different amounts of items (based on how many items are in the array)<BR><BR>I have been checking out datalists and datagrids...but not sure if that would work?<BR>Any ideas or guidance would be great! Thanks.

  2. #2
    Join Date
    Dec 1969

    Default Probably a DataSet...

    ...I would assume that you will end up stuffing this data into a database, no? So why not use a DataSet. Then you can ask the system to update the database based on the DataSet contents, if you want to.<BR><BR>But failing that, I&#039;d use an array of your own class.<BR><BR>E.g.:<BR> Class CartProduct<BR> public prodID As Integer<BR> public quantity As Integer<BR> public prodName As String<BR> public prodDescription As String<BR> End Class<BR>and then<BR> Dim cart As CartProduct()<BR>or<BR> Dim cart(20) As CartProduct<BR>or whatever.<BR><BR>Naturally, it&#039;s better not to make the data members Public as I show, instead using Property&#039;s to access private members, but that&#039;s a matter of refinement, not requirement.<BR><BR>

Posting Permissions

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