I try to download files from gridview .. i save files in database and then i display in gridview i try this
but this shows an error
An exception of type 'System.InvalidCastException' occurred in DecibelCRM.dll but was not handled in user code
Additional information: Unable to cast object of type 'System.DBNull' to type 'System.Byte[]'.
on this line
Dim binary() As Byte = DirectCast(structDb.dstResult.Tables(0).Rows(i).Item("document"), Byte())
my sp result look like this
documentid documentname DOCUMENT Docextension
43 Employment .pdf 0x255044462D312E330D25E2E3... .pdf
614 Information.xlsx 0xFFD8FFE12FFE4578696600004D... .xlsx
615 pdf.pdf 0x504B0304140006000... .pdf
616 IMG_0207.JPG 0x456dfghs70004.... .jpg