اذا كانت البيانات مخزنة على شكل Binary
كود :
Dim dt_pdf As New DataTable
Dim DgId As Integer
Private Sub DataGridView1_CellClick(sender As Object, e As DataGridViewCellEventArgs) Handles DataGridView1.CellClick
DgId = e.RowIndex
End Sub
' تحويل الكود المسجل بقاعدة البيانات الى ملف
Dim ff() As Byte = CType(dt_pdf.Rows(DgId)(4), Byte())
Dim FPath = Application.StartupPath & "\" & dt_pdf.Rows(DgId)(2).ToString() & dt_pdf.Rows(DgId)(3).ToString()
Dim FFS As FileStream = New FileStream(FPath, FileMode.Create, FileAccess.Write)
FFS.Write(ff, 0, ff.Length)
FFS.Close()
' تنفيذ فتح الملف بعد انشائه بالكود السابق
Process.Start(FPath)
