Dim ds As New DataSet Dim adp As New SqlDataAdapter(StrSql, Con) adp.Fill(ds) 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)
If you want to load other file, just call method pdfDocumentViewer1.LoadFromFile ("yourfilepath"); if you want to close the opened file, call method pdfDocumentViewer1.CloseDocument().