We have thousands of products and the product information is stored on the database. The images for the products are stored on a network hard drive. Pulling the images, sizing and displaying them on a grid with product information for a quote that has over 900 different products took so long that although it completed the code, it did not completely paint the display.
If webcontent IsNot Nothing Then
itemRow.ItemWebHead = webcontent.WebHead
Dim imgNames As String = webcontent.ImageName
Dim imgNamesCol As New List(Of String)(Split(imgNames, VM))
itemRow.ImageConfig = New dataSourceQuote.PictureBoxConfig(imgNamesCol)
If imgNamesCol.Count = 1 Then
itemRow.ImagePath = ImgHelperClass.WebImagePath + ImgHelperClass.SetImageFileWithRes(imgNamesCol(0), ImgHelperClass.WebImageRes)
ElseIf imgNamesCol.Count > 1 Then
itemRow.ImagePath = ImgHelperClass.WebImagePath + ImgHelperClass.SetImageFileWithRes(imgNamesCol(0), ImgHelperClass.WebImageRes)
ElseIf imgNamesCol.Count = 0 Then
itemRow.ImagePath = ImgHelperClass.strSaveLocation + "\" + ImgHelperClass.ImageNotAvailable
End If
itemRow.Description = Me.GetSpecsString(webcontent)
Else
itemRow.ImageConfig = New dataSourceQuote.PictureBoxConfig(Nothing)
itemRow.ImagePath = ImgHelperClass.strSaveLocation + "\" + ImgHelperClass.ImageNotAvailable
End If
Would it be faster if the images were stored on a SQL database instead of a network drive?