Click here to Skip to main content
15,922,325 members
Home / Discussions / C#
   

C#

 
GeneralRe: Stopping Process Pin
PIEBALDconsult22-Jul-10 3:21
mvePIEBALDconsult22-Jul-10 3:21 
GeneralRe: Stopping Process Pin
anveshvm22-Jul-10 4:16
anveshvm22-Jul-10 4:16 
GeneralRe: Stopping Process Pin
PIEBALDconsult22-Jul-10 3:35
mvePIEBALDconsult22-Jul-10 3:35 
AnswerRe: Stopping Process Pin
PIEBALDconsult21-Jul-10 17:36
mvePIEBALDconsult21-Jul-10 17:36 
Questionsave data structure in resource dll Pin
Jassim Rahma21-Jul-10 5:36
Jassim Rahma21-Jul-10 5:36 
AnswerRe: save data structure in resource dll Pin
Ennis Ray Lynch, Jr.21-Jul-10 5:40
Ennis Ray Lynch, Jr.21-Jul-10 5:40 
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 
Hi,

I am having problem in displaying report in doc file. the code is


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();
" }

in="" this="" code,="" if="" i="" write="" the="" file="" inside="" while(dr.read()),="" it="" works="" fine="" but="" when="" tried="" to="" for="" loop,="" doesn't="" give="" output.=""

why="" is="" that="" and="" how="" solve="" ??="" any="" idea="" ??
<div="" class="signature">sm
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 
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 

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.