Click here to Skip to main content
15,916,030 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: urgent copy image from hard Drive on local host Pin
N a v a n e e t h19-Sep-07 23:37
N a v a n e e t h19-Sep-07 23:37 
GeneralRe: urgent copy image from hard Drive on local host Pin
mavii19-Sep-07 23:48
mavii19-Sep-07 23:48 
GeneralRe: urgent copy image from hard Drive on local host Pin
N a v a n e e t h19-Sep-07 23:52
N a v a n e e t h19-Sep-07 23:52 
GeneralRe: urgent copy image from hard Drive on local host Pin
mavii20-Sep-07 0:15
mavii20-Sep-07 0:15 
GeneralRe: urgent copy image from hard Drive on local host Pin
mavii20-Sep-07 0:36
mavii20-Sep-07 0:36 
AnswerRe: urgent copy image from hard Drive on local host Pin
APDevelop19-Sep-07 23:14
APDevelop19-Sep-07 23:14 
GeneralRe: urgent copy image from hard Drive on local host Pin
mavii19-Sep-07 23:18
mavii19-Sep-07 23:18 
QuestionHow to retrieve word document from database [modified] Pin
honeysip19-Sep-07 22:40
honeysip19-Sep-07 22:40 
Hi,

I am working on one application in asp.net and it requires file uploading(word documents)...

I am able to upload and save it in database...

I am using Sqlserver2005 and i took datatype image to store the uploaded file..

The document is storing in binary format in database...

Now,i want to retrieve the document in a Textbox which i am not able to do...


This is the code i used for fileuploading...


if (FileUpload1.FileName != "")
{
Stream ImageStream;
int intImageSize = FileUpload1.PostedFile.ContentLength;
byte[] ImageContent = new byte[intImageSize];
ImageStream = FileUpload1.PostedFile.InputStream;
int intStatus;
intStatus = ImageStream.Read(ImageContent, 0, intImageSize);
try
{ con.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = "Image_table";

SqlParameter p = new SqlParameter();
p.ParameterName = "@Content";
p.SqlDbType = SqlDbType.Image;
p.Value = ImageContent;
cmd.Parameters.Add(p);
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
finally
{
con.Close();
}
}


Using this code the uploaded file is stored in the database in binary format...

Now i want to retrieve it...

can any one help me in doing this...



-- modified at 5:27 Thursday 20th September, 2007
AnswerRe: How to retrieve word document from database Pin
N a v a n e e t h19-Sep-07 23:48
N a v a n e e t h19-Sep-07 23:48 
GeneralRe: How to retrieve word document from database Pin
honeysip20-Sep-07 0:58
honeysip20-Sep-07 0:58 
GeneralRe: How to retrieve word document from database Pin
N a v a n e e t h20-Sep-07 3:06
N a v a n e e t h20-Sep-07 3:06 
Questionswitchover to new version Pin
syibu19-Sep-07 22:34
syibu19-Sep-07 22:34 
AnswerRe: switchover to new version Pin
APDevelop19-Sep-07 23:41
APDevelop19-Sep-07 23:41 
GeneralRe: switchover to new version Pin
syibu20-Sep-07 0:02
syibu20-Sep-07 0:02 
Questionasp database: ADO Connection to SQL Server Pin
nhatphuong200619-Sep-07 22:30
nhatphuong200619-Sep-07 22:30 
AnswerRe: asp database: ADO Connection to SQL Server Pin
Fred_Smith19-Sep-07 22:34
Fred_Smith19-Sep-07 22:34 
AnswerRe: asp database: ADO Connection to SQL Server Pin
wuriskly19-Sep-07 23:22
wuriskly19-Sep-07 23:22 
QuestionUpload File via FTP using ASP.net 1.1 Pin
wEb GuRu...19-Sep-07 22:29
wEb GuRu...19-Sep-07 22:29 
AnswerRe: Upload File via FTP using ASP.net 1.1 Pin
yogesh_kumar_agarwal19-Sep-07 22:33
yogesh_kumar_agarwal19-Sep-07 22:33 
GeneralRe: Upload File via FTP using ASP.net 1.1 Pin
APDevelop19-Sep-07 22:53
APDevelop19-Sep-07 22:53 
QuestionIs it suggested to have many sessions in application Pin
MD1219-Sep-07 22:27
MD1219-Sep-07 22:27 
AnswerRe: Is it suggested to have many sessions in application Pin
wEb GuRu...19-Sep-07 22:30
wEb GuRu...19-Sep-07 22:30 
AnswerRe: Is it suggested to have many sessions in application Pin
Sandeep Akhare19-Sep-07 22:56
Sandeep Akhare19-Sep-07 22:56 
QuestionRe-installing IIS on SBS 2003 Premium [modified] Pin
Vimalsoft(Pty) Ltd19-Sep-07 22:23
professionalVimalsoft(Pty) Ltd19-Sep-07 22:23 
QuestionBack Button Pin
yogesh_kumar_agarwal19-Sep-07 22:13
yogesh_kumar_agarwal19-Sep-07 22:13 

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.