Click here to Skip to main content
15,913,722 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Crystal Report Error Pin
N a v a n e e t h30-Jul-07 3:13
N a v a n e e t h30-Jul-07 3:13 
QuestionHow can i integrate my web site with paypal? Pin
kimo code30-Jul-07 0:52
kimo code30-Jul-07 0:52 
AnswerRe: How can i integrate my web site with paypal? Pin
Christian Graus30-Jul-07 1:08
protectorChristian Graus30-Jul-07 1:08 
GeneralRe: How can i integrate my web site with paypal? Pin
kimo code30-Jul-07 3:18
kimo code30-Jul-07 3:18 
GeneralRe: How can i integrate my web site with paypal? Pin
Christian Graus30-Jul-07 11:03
protectorChristian Graus30-Jul-07 11:03 
Questionhow i use credit card Pin
ajau30-Jul-07 0:15
ajau30-Jul-07 0:15 
AnswerRe: how i use credit card Pin
N a v a n e e t h30-Jul-07 0:40
N a v a n e e t h30-Jul-07 0:40 
QuestionDisplaying binary data other than images [modified] Pin
ASPnoob29-Jul-07 23:10
ASPnoob29-Jul-07 23:10 
Hi, awhile ago I had asked this same question after many failed attempts to display binary data in a label. I am trying to display other types of binary data like ms word, PDF documents etc using the same method that was used for displaying images. I am just guessing that it would mostly be the same. The following is what I have seen many people do when displaying images. They would use the ExecuteScalar() method of the SqlCommand class to read the BLOB, then caste the data by putting it in a byte array. After that they would stream it to the HTTP response and use a HtmlServerControl to display it in the browser. I was not able to get it to display text documents. How do I modify the code below to display other types of binary data? Thank you in advance for your help.

private void Page_Load(object sender, System.EventArgs e)
{
    if(!IsPostBack)
    {
        CreateImage(Request["id"]);
    }
}

End Sub 

 Private Sub CreateImage(ByVal id As String)
	' Connectoin string is taken from web.config file.
	Dim _con As New SqlConnection(System.Configuration.ConfigurationSettings.AppSettings("DB"))

	Try
		_con.Open()
		Dim _cmd As SqlCommand = _con.CreateCommand()
		_cmd.CommandText = "select logo from" + " pub_info where pub_id='" + id + "'"
		Dim _buf As Byte() = CByte(_cmd.ExecuteScalar())

		' This is optional
		Response.ContentType = "image/gif"

		'stream it back in the HTTP response


		Response.BinaryWrite(_buf)
	Catch
	Finally

		_con.Close()
	End Try
End Sub




-- modified at 5:31 Monday 30th July, 2007
AnswerRe: Displaying binary data other than images Pin
Christian Graus29-Jul-07 23:30
protectorChristian Graus29-Jul-07 23:30 
GeneralRe: Displaying binary data other than images [modified] Pin
ASPnoob29-Jul-07 23:54
ASPnoob29-Jul-07 23:54 
GeneralRe: Displaying binary data other than images Pin
Christian Graus30-Jul-07 1:09
protectorChristian Graus30-Jul-07 1:09 
QuestionCalling DataLayer From Presentation Layer Pin
N a v a n e e t h29-Jul-07 22:54
N a v a n e e t h29-Jul-07 22:54 
AnswerRe: Calling DataLayer From Presentation Layer Pin
Christian Graus29-Jul-07 23:05
protectorChristian Graus29-Jul-07 23:05 
GeneralRe: Calling DataLayer From Presentation Layer Pin
N a v a n e e t h29-Jul-07 23:31
N a v a n e e t h29-Jul-07 23:31 
GeneralRe: Calling DataLayer From Presentation Layer Pin
Christian Graus30-Jul-07 1:11
protectorChristian Graus30-Jul-07 1:11 
AnswerRe: Calling DataLayer From Presentation Layer Pin
BasharatAli29-Jul-07 23:09
BasharatAli29-Jul-07 23:09 
Questionpreview a picture from my hard disk before upload it Pin
ayeleteric29-Jul-07 22:49
ayeleteric29-Jul-07 22:49 
AnswerRe: preview a picture from my hard disk before upload it Pin
N a v a n e e t h29-Jul-07 23:03
N a v a n e e t h29-Jul-07 23:03 
GeneralRe: preview a picture from my hard disk before upload it [modified] Pin
ayeleteric29-Jul-07 23:06
ayeleteric29-Jul-07 23:06 
GeneralRe: preview a picture from my hard disk before upload it Pin
N a v a n e e t h29-Jul-07 23:55
N a v a n e e t h29-Jul-07 23:55 
GeneralRe: preview a picture from my hard disk before upload it Pin
ayeleteric30-Jul-07 0:05
ayeleteric30-Jul-07 0:05 
AnswerRe: preview a picture from my hard disk before upload it Pin
enjoycrack29-Jul-07 23:56
enjoycrack29-Jul-07 23:56 
GeneralRe: preview a picture from my hard disk before upload it Pin
ayeleteric30-Jul-07 0:06
ayeleteric30-Jul-07 0:06 
GeneralRe: preview a picture from my hard disk before upload it Pin
enjoycrack30-Jul-07 0:09
enjoycrack30-Jul-07 0:09 
GeneralRe: preview a picture from my hard disk before upload it Pin
ayeleteric30-Jul-07 0:18
ayeleteric30-Jul-07 0:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.