Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
4
Reply
How to convert Binary Data to PDF file when click on Button
Supraja
Jul 11 2016 2:07 AM
642
Reply
I have Binary data in sql when user click on button it should convert binary data to pdf file for this i created aspx page in that i have date and report name and button when user select name and date and click on button then it should search for the date in sql and get the binary data to pdf file to download.
Private Sub btnTrade_Click(sender As Object, e As EventArgs) Handles btnTrade.Click
Dim cn As New SqlConnection
cn.ConnectionString = conStrEMC
Dim bytes As Byte()
Context.Response.Buffer = True
Context.Response.Charset = ""
'If context.Request.QueryString("download") = "1" Then
' context.Response.AppendHeader("Content-Disposition", Convert.ToString("attachment; filename=") & STLId)
'End If
Context.Response.Cache.SetCacheability(HttpCacheability.NoCache)
Context.Response.ContentType = "application/pdf"
Context.Response.BinaryWrite(bytes)
Context.Response.Flush()
Context.Response.[End]()
End Sub
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
Move Multiple user Control in picture box at runtime
How to Set Default value for datagridview combobox column