لم يتنفد لي الكود
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If Me.ListBox1.SelectedValue Is Nothing Then
Exit Sub
End If
Dim sql As String = "SELECT pdfname,pdfdata FROM table_1 WHERE id = " & Me.ListBox1.SelectedValue
Dim da1 As New SqlDataAdapter(sql, con)
If da.Fill(dt) > 0 Then
Dim row As DataRow = dt.Rows(0)
Dim tmpPath As String = IO.Path.GetTempPath
Dim fileName As String = tmpPath & "\" & row("pdfname")
IO.File.WriteAllBytes(fileName, row("pdfdata"))
Process.Start(fileName)
End If
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If Me.ListBox1.SelectedValue Is Nothing Then
Exit Sub
End If
Dim sql As String = "SELECT pdfname,pdfdata FROM table_1 WHERE id = " & Me.ListBox1.SelectedValue
Dim da1 As New SqlDataAdapter(sql, con)
If da.Fill(dt) > 0 Then
Dim row As DataRow = dt.Rows(0)
Dim tmpPath As String = IO.Path.GetTempPath
Dim fileName As String = tmpPath & "\" & row("pdfname")
IO.File.WriteAllBytes(fileName, row("pdfdata"))
Process.Start(fileName)
End If