Click here to Skip to main content
15,892,839 members
Home / Discussions / C#
   

C#

 
GeneralRe: save data structure in resource dll Pin
Jassim Rahma21-Jul-10 5:44
Jassim Rahma21-Jul-10 5:44 
Questionproblem writing in doc file Pin
Dhyanga21-Jul-10 5:29
Dhyanga21-Jul-10 5:29 
AnswerRe: problem writing in doc file Pin
Ennis Ray Lynch, Jr.21-Jul-10 5:38
Ennis Ray Lynch, Jr.21-Jul-10 5:38 
GeneralRe: problem writing in doc file Pin
Dhyanga21-Jul-10 5:48
Dhyanga21-Jul-10 5:48 
AnswerRe: problem writing in doc file Pin
OriginalGriff21-Jul-10 5:39
mveOriginalGriff21-Jul-10 5:39 
GeneralRe: problem writing in doc file Pin
Dhyanga21-Jul-10 5:42
Dhyanga21-Jul-10 5:42 
GeneralRe: problem writing in doc file Pin
OriginalGriff21-Jul-10 5:51
mveOriginalGriff21-Jul-10 5:51 
GeneralRe: problem writing in doc file Pin
Dhyanga21-Jul-10 5:54
Dhyanga21-Jul-10 5:54 
Thank you. I never used code block before. anyway it makes easy to read the code.

SqlConnection cnx = new SqlConnection(categories.strCnx);
cnx.Open();
string query = @"select * from categories";
SqlCommand cmd = cnx.CreateCommand();
cmd.CommandText = query;
SqlDataReader dr;
HttpContext.Current.Response.Clear(); //clear anything in io buffer
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=categories.doc");
HttpContext.Current.Response.Charset = "";
HttpContext.Current.Response.ContentType = "application/vnd.ms-document";
HttpContext.Current.Response.Write("categories" + '\n');

try
{
i = 0;
dr = cmd.ExecuteReader();
while (dr.Read())
{
s[i]= dr[0].tostring();
i++;

}
for (int j = 0;j<i;j++)
{
HttpContext.Current.Response.Write(s[j].ToString() + '\n');
}

HttpContext.Current.Response.End();
}
catch(Exception ex)
{
string pt = ex.ToString();

}


Thanks
suchita

GeneralRe: problem writing in doc file Pin
OriginalGriff21-Jul-10 6:03
mveOriginalGriff21-Jul-10 6:03 
GeneralRe: problem writing in doc file Pin
Dhyanga21-Jul-10 6:09
Dhyanga21-Jul-10 6:09 
GeneralRe: problem writing in doc file Pin
OriginalGriff21-Jul-10 8:54
mveOriginalGriff21-Jul-10 8:54 
GeneralRe: problem writing in doc file Pin
Dhyanga21-Jul-10 9:44
Dhyanga21-Jul-10 9:44 
GeneralRe: problem writing in doc file Pin
OriginalGriff21-Jul-10 9:51
mveOriginalGriff21-Jul-10 9:51 
GeneralRe: problem writing in doc file Pin
Dhyanga21-Jul-10 10:10
Dhyanga21-Jul-10 10:10 
GeneralRe: problem writing in doc file Pin
OriginalGriff21-Jul-10 21:55
mveOriginalGriff21-Jul-10 21:55 
GeneralRe: problem writing in doc file Pin
Dhyanga22-Jul-10 3:00
Dhyanga22-Jul-10 3:00 
GeneralRe: problem writing in doc file Pin
OriginalGriff22-Jul-10 3:49
mveOriginalGriff22-Jul-10 3:49 
GeneralRe: problem writing in doc file Pin
Dhyanga22-Jul-10 4:14
Dhyanga22-Jul-10 4:14 
GeneralRe: problem writing in doc file [modified] Pin
Dhyanga22-Jul-10 4:17
Dhyanga22-Jul-10 4:17 
QuestionLine on open/close brackets Pin
Blubbo21-Jul-10 4:26
Blubbo21-Jul-10 4:26 
AnswerRe: Line on open/close brackets Pin
Ennis Ray Lynch, Jr.21-Jul-10 4:36
Ennis Ray Lynch, Jr.21-Jul-10 4:36 
AnswerRe: Line on open/close brackets Pin
OriginalGriff21-Jul-10 4:56
mveOriginalGriff21-Jul-10 4:56 
AnswerRe: Line on open/close brackets Pin
PIEBALDconsult21-Jul-10 18:22
mvePIEBALDconsult21-Jul-10 18:22 
Questionconvert date question Pin
Jassim Rahma21-Jul-10 3:36
Jassim Rahma21-Jul-10 3:36 
AnswerRe: convert date question Pin
OriginalGriff21-Jul-10 3:46
mveOriginalGriff21-Jul-10 3:46 

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.