Dim strFileNm As IO.MemoryStream
Dim arrPDF As Byte()
arrPDF = ds.Tables(0).Rows(0)("ATTCH_DOC")
strFileNm = New IO.MemoryStream(arrPDF)
pdfDocumentViewer1.LoadFromStream(strFileNm)
when i view the pdf the file is loading but in white blank.
Dim array As Byte() = File.ReadAllBytes("SK-SP-16.pdf")
Dim ms As New MemoryStream(array)
pdfDocumentViewer1.LoadFromStream(ms)
Dim adp As SqlDataAdapter
Dim ds As New DataSet
Dim strFileNm As IO.MemoryStream
Dim arrPDF As Byte()
Dim intPDFCount As Integer = 0
Try
StrSql = "SELECT ATTCH_DOC FROM ATTCH_WRK "
StrSql += "WHERE ATTCH_WRKNO = '" & Me.WorkTableNo & "' "
StrSql += "AND ATTCH_REFID = '" & dgvATTCH.CurrentRow.Cells("ATTCH_REFID").Value.ToString & "'"
adp = New SqlDataAdapter(StrSql, Con)
adp.Fill(ds)
If ds.Tables.Count > 0 Then
For intPDFCount = 0 To ds.Tables(0).Rows.Count - 1
If ds.Tables(0).Rows(0)("ATTCH_DOC") Is DBNull.Value Then
Else
arrPDF = ds.Tables(0).Rows(0)("ATTCH_DOC")
strFileNm = New IO.MemoryStream(arrPDF)
pdfDocumentViewer1.LoadFromStream(strFileNm)
End If
Next
End If
Catch ex As Exception
MsgBox(ex.Message)
Finally
adp = Nothing
ds = Nothing
strFileNm = Nothing
arrPDF = Nothing
End Try