I have successfully uploaded pdf into DB: but how do i read the pdf? Thanks
Protected
Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click
For Each file As UploadedFile In RadUpload1.UploadedFiles
Dim bytes As Byte() = New Byte(file.InputStream.Length) {}
file.InputStream.Read(bytes, 0,
DirectCast((file.InputStream.Length), Long))
Dim strImageName As String = txtName.Text.ToString()
Dim con As New SqlConnection()
con.ConnectionString = ConfigurationManager.ConnectionStrings(
"ConnectionString").ConnectionString
Dim cmd As New SqlCommand()
cmd.CommandText =
"spPDFtest"
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = con
Dim ImageName As New SqlParameter("@pdfName", SqlDbType.VarChar, 50)
ImageName.Value = strImageName.ToString()
cmd.Parameters.Add(ImageName)
Dim UploadedImage As New SqlParameter("@pdf", SqlDbType.Image, bytes.Length)
UploadedImage.Value = bytes
cmd.Parameters.Add(UploadedImage)
con.Open()
Dim result As Integer = cmd.ExecuteNonQuery()
con.Close()
If result > 0 Then
lblMessage.Text =
"File Uploaded"
End If
Next
End Sub