TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Supraja
NA
25
7.8k
How to convert Binary Data to PDF file when click on Button
Jul 11 2016 2:07 AM
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
Reply
Answers (
4
)
COncept of Methods
Error - Insert data into Access database in c#