Click here to Skip to main content
15,890,609 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionRe: How to Bind Repeater Data with label controls Pin
sk27ahmed14-Apr-08 0:04
sk27ahmed14-Apr-08 0:04 
GeneralRe: How to Bind Repeater Data with label controls Pin
N a v a n e e t h14-Apr-08 0:10
N a v a n e e t h14-Apr-08 0:10 
QuestionRe: How to Bind Repeater Data with label controls Pin
sk27ahmed14-Apr-08 3:00
sk27ahmed14-Apr-08 3:00 
GeneralLanguage of Outlook File Pin
pjc*13-Apr-08 22:21
pjc*13-Apr-08 22:21 
GeneralRe: Language of Outlook File Pin
N a v a n e e t h13-Apr-08 22:44
N a v a n e e t h13-Apr-08 22:44 
GeneralRe: Language of Outlook File Pin
pjc*13-Apr-08 23:27
pjc*13-Apr-08 23:27 
GeneralRe: Language of Outlook File Pin
N a v a n e e t h14-Apr-08 0:05
N a v a n e e t h14-Apr-08 0:05 
Generalviewing a word document Pin
Cuckoo13-Apr-08 19:37
Cuckoo13-Apr-08 19:37 
I am having an application in which i am supposed to stored a word document in data base and on a click event we should be able to see the word doc as a word file.

I was successful in storing the word document in data base. In the table the datatype is of image,and i have stored it in word formate.

But i am unable to retrieve it.

the codes i have used is as below.


if(fileUpload.PostedFile != null)

{

intDocLen = fileUpload.PostedFile.ContentLength;
byte[] Docbuffer = new byte[intDocLen];
Stream objStream;
objStream = fileUpload.PostedFile.InputStream;
objStream.Read(Docbuffer,0,intDocLen);

string query="insert into hr_resume1(can_name,age,resume)values('"+txt_name.Text+"','"+txt_age.Text+"','"+Docbuffer+"')";
Obj_db_con.ExecuteQry(query);


}
and for getting it back from the database i have used the code.


if(e.CommandName=="view")
{
//Session["job_id"]=e.Item.Cells[0].Text;
string c_id=e.Item.Cells[0].Text;
string query2="select resume from hr_resume where cand_id='"+c_id+"'";
SqlDataAdapter da = new SqlDataAdapter(query2,con);
DataSet ds = new DataSet();
da.Fill(ds);


Response.ContentType = "appliaction/msword";
// Remove the charset from the Content-Type header.
Response.AppendHeader("content-disposition", "attachment;filename=FileName.doc");
Response.Charset = "";
// Turn off the view state.
this.EnableViewState = false;
StringWriter tw = new System.IO.StringWriter();
HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
// Get the HTML for the control.
RenderControl(hw);
//Write the HTML back to the browser.
Response.Write(tw.ToString());
// End the response.
Response.End();

}
But i am not able to see the file.
GeneralRe: viewing a word document Pin
Christian Graus13-Apr-08 19:41
protectorChristian Graus13-Apr-08 19:41 
GeneralRe: viewing a word document Pin
Cuckoo13-Apr-08 20:00
Cuckoo13-Apr-08 20:00 
GeneralRe: viewing a word document Pin
Christian Graus13-Apr-08 20:54
protectorChristian Graus13-Apr-08 20:54 
GeneralRe: viewing a word document Pin
Cuckoo13-Apr-08 21:09
Cuckoo13-Apr-08 21:09 
GeneralRe: viewing a word document Pin
eyeseetee13-Apr-08 21:26
eyeseetee13-Apr-08 21:26 
Generalembedding images problem Pin
Varun12313-Apr-08 18:24
Varun12313-Apr-08 18:24 
GeneralRe: embedding images problem Pin
Christian Graus13-Apr-08 18:52
protectorChristian Graus13-Apr-08 18:52 
Question<%# %> <%$ %> <%= %> Where can i find more info about these instructions? Pin
AlexeiXX313-Apr-08 16:42
AlexeiXX313-Apr-08 16:42 
AnswerRe: <%# %> <%$ %> <%= %> Where can i find more info about these instructions? Pin
Christian Graus13-Apr-08 17:24
protectorChristian Graus13-Apr-08 17:24 
GeneralRe: <%# %> <%$ %> <%= %> Where can i find more info about these instructions? Pin
AlexeiXX313-Apr-08 18:20
AlexeiXX313-Apr-08 18:20 
GeneralRe: <%# %> <%$ %> <%= %> Where can i find more info about these instructions? Pin
Christian Graus13-Apr-08 18:22
protectorChristian Graus13-Apr-08 18:22 
GeneralRe: <%# %> <%$ %> <%= %> Where can i find more info about these instructions? Pin
J4amieC13-Apr-08 22:43
J4amieC13-Apr-08 22:43 
GeneralSet property of control with a resource key Pin
AlexeiXX313-Apr-08 16:39
AlexeiXX313-Apr-08 16:39 
GeneralRe: Set property of control with a resource key Pin
Christian Graus13-Apr-08 17:24
protectorChristian Graus13-Apr-08 17:24 
GeneralRe: Set property of control with a resource key Pin
AlexeiXX313-Apr-08 18:18
AlexeiXX313-Apr-08 18:18 
GeneralRe: Set property of control with a resource key Pin
Christian Graus13-Apr-08 18:21
protectorChristian Graus13-Apr-08 18:21 
GeneralRe: Set property of control with a resource key Pin
AlexeiXX313-Apr-08 19:01
AlexeiXX313-Apr-08 19:01 

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.