VB.NET  •  Display Product Reviews

Listing 1. This portion of ListReviews' Render method prepares the HTML code to display either a table with every review for the specified product or only the last review.

If ProductID > 0 Then
   If m_strXMLPath.EndsWith("\") = _
      False Then
      strXMLPath = m_strXMLPath & "\" _
         & m_lProductID.ToString() & _
         ".xml"
   Else
      strXMLPath = m_strXMLPath & _
         m_lProductID.ToString() & ".xml"
   End If

m_dsReviews.ReadXml(strXMLPath)
If m_bLastReview = True Then
   m_dsReviews.REVIEW.DefaultView. _
      Sort = "ID_REVIEW DESC"
   Dim dv As DataRowView = _
      m_dsReviews.REVIEW.DefaultView(0)