Click here to Skip to main content
15,900,648 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionlogin page & browse button coding Pin
gag876-Feb-08 21:30
gag876-Feb-08 21:30 
GeneralRe: login page & browse button coding Pin
pmarfleet6-Feb-08 21:52
pmarfleet6-Feb-08 21:52 
GeneralRe: login page & browse button coding Pin
Gandalf_TheWhite6-Feb-08 22:53
professionalGandalf_TheWhite6-Feb-08 22:53 
GeneralRe: login page & browse button coding Pin
dilipv7-Feb-08 20:05
dilipv7-Feb-08 20:05 
QuestionHow to send newsletter to multiple clients [modified] Pin
thinkers6-Feb-08 21:12
thinkers6-Feb-08 21:12 
GeneralRe: How to send newsletter to multiple clients Pin
Vasudevan Deepak Kumar6-Feb-08 21:20
Vasudevan Deepak Kumar6-Feb-08 21:20 
GeneralRe: How to send newsletter to multiple clients Pin
thinkers6-Feb-08 22:22
thinkers6-Feb-08 22:22 
Questionhow to Download Binary file stored in the database [modified] Pin
Member 44071146-Feb-08 20:38
Member 44071146-Feb-08 20:38 
Hello guys you really did the best for me.I am still new in programming world.
and Forgive me,for my poor English,I was successfully able to Upload my Binary file to the database but the challenging part came when I was trying to Download those binary file Like Pdf,doc FROM DATABASE
this is my DAtabase
CREATE TABLE ATTACHMENT
AttachmentID INT (PK),
FName varchar(50),
TYPE varchar(200),
Logo picture,
//Path varchar(200)
I don't want this code to download binary file from path all I need is to download from database as attachment,one of important thing,HOW TO use MemoryStream
this the code I used it on my website

protected void btnDownLoad_Click(object sender, EventArgs e)
{if (drpAttachmentID.Text != "select")
{SqlConnection cnn = null;
try{string display = " select Logo from Attachment where AttachmentID = '" + drpAttachmentID.Text + "'";
cnn = new SqlConnection(sqlcnstr);
SqlCommand cmd = new SqlCommand(display, cnn);
cnn.Open();
SqlDataReader reader = cmd.ExecuteReader();
if (reader.HasRows == true)
{ reader.Read();
Response.ContentType = "application/octect-stream";
Response.BinaryWrite((byte[])reader["Logo"]);
Response.AddHeader("Content-Length", byteArray.Length.ToString());}
else{ this.RegisterClientScriptBlock("alertMsg", "<script>alert(no Image);</script>");
}reader.Close();}catch (Exception err)
{lblMsg.Text = err.Message;
}
}
else
{ lblMsg.Text += "Please select AttachmentID 1st ";}
}//end
THIS CODE IS ONLY ABLE TO DOWNLOAD THE PICTURE BUT CANNOT DOWNLOAD DPF,DOC
from kagisobk@gmail.com
THANKS FROM ALL OF YOU GUYS

<div class="ForumMod">modified on Thursday, February 07, 2008 2:49:27 AM</div>
GeneralRe: how to Download Binary file stored in the database Pin
Vasudevan Deepak Kumar6-Feb-08 21:22
Vasudevan Deepak Kumar6-Feb-08 21:22 
Generalonclick event for anchor tag Pin
sirisha guttikonda6-Feb-08 20:32
sirisha guttikonda6-Feb-08 20:32 
GeneralRe: onclick event for anchor tag Pin
sulabh20206-Feb-08 20:37
sulabh20206-Feb-08 20:37 
GeneralRe: onclick event for anchor tag Pin
sirisha guttikonda6-Feb-08 20:39
sirisha guttikonda6-Feb-08 20:39 
GeneralRe: onclick event for anchor tag Pin
Kunal Pawar7-Feb-08 0:47
Kunal Pawar7-Feb-08 0:47 
GeneralRowcommand with Multiple Datakeys [modified] Pin
Vinay Dornala6-Feb-08 20:17
Vinay Dornala6-Feb-08 20:17 
Questionhow do I refresh a page? Pin
Shimmy Weitzhandler6-Feb-08 20:03
Shimmy Weitzhandler6-Feb-08 20:03 
GeneralRe: how do I refresh a page? Pin
sulabh20206-Feb-08 20:18
sulabh20206-Feb-08 20:18 
AnswerRe: how do I refresh a page? Pin
GDMFSOB6-Feb-08 20:19
GDMFSOB6-Feb-08 20:19 
GeneralRe: how do I refresh a page? Pin
hakervytas6-Feb-08 21:41
hakervytas6-Feb-08 21:41 
GeneralRe: how do I refresh a page? Pin
Shimmy Weitzhandler7-Feb-08 2:13
Shimmy Weitzhandler7-Feb-08 2:13 
GeneralRe: how do I refresh a page? Pin
Sandeep Akhare7-Feb-08 0:31
Sandeep Akhare7-Feb-08 0:31 
GeneralRe: how do I refresh a page? [modified] Pin
Shimmy Weitzhandler7-Feb-08 20:06
Shimmy Weitzhandler7-Feb-08 20:06 
Questionwhat is sqldatahandler Pin
saravanan056-Feb-08 19:25
saravanan056-Feb-08 19:25 
AnswerRe: what is sqldatahandler Pin
Abhijit Jana6-Feb-08 19:49
professionalAbhijit Jana6-Feb-08 19:49 
Question@ permissions to a specific directory. Pin
Amit.Amit.Amit...6-Feb-08 19:25
Amit.Amit.Amit...6-Feb-08 19:25 
Generalrewrite url dynamically using gloabal app class Pin
trilokharry6-Feb-08 19:25
trilokharry6-Feb-08 19:25 

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.