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

ASP.NET

 
AnswerRe: Global Distribution System in ASP.NET website Pin
Peace ON21-Jul-10 21:15
Peace ON21-Jul-10 21:15 
QuestionGridview Column colors Pin
codingrocks21-Jul-10 18:40
codingrocks21-Jul-10 18:40 
AnswerRe: Gridview Column colors Pin
Prosanta Kundu online21-Jul-10 19:01
Prosanta Kundu online21-Jul-10 19:01 
AnswerRe: Gridview Column colors Pin
Peace ON21-Jul-10 19:44
Peace ON21-Jul-10 19:44 
QuestionGetting sessions to ASMX webservice Pin
Matt Cavanagh21-Jul-10 8:40
Matt Cavanagh21-Jul-10 8:40 
AnswerRe: Getting sessions to ASMX webservice Pin
Yusuf21-Jul-10 9:01
Yusuf21-Jul-10 9:01 
QuestionRe: Getting sessions to ASMX webservice [modified] Pin
Matt Cavanagh21-Jul-10 9:30
Matt Cavanagh21-Jul-10 9:30 
Questionproblem writing in doc file Pin
Dhyanga21-Jul-10 5:39
Dhyanga21-Jul-10 5:39 
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
{
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 the while(dr.read()), it works fine but when i tried to write it inside the for loop, it doesn't give the output.

Why is that and how to solve it ?? Any idea ??
sm

AnswerRe: problem writing in doc file Pin
Yusuf21-Jul-10 6:06
Yusuf21-Jul-10 6:06 
GeneralRe: problem writing in doc file [modified] Pin
Dhyanga21-Jul-10 6:14
Dhyanga21-Jul-10 6:14 
QuestionJava script reset problem Pin
immu521-Jul-10 5:37
immu521-Jul-10 5:37 
AnswerRe: Java script reset problem Pin
Yusuf21-Jul-10 6:18
Yusuf21-Jul-10 6:18 
AnswerRe: Java script reset problem Pin
Not Active21-Jul-10 8:53
mentorNot Active21-Jul-10 8:53 
GeneralRe: Java script reset problem Pin
immu521-Jul-10 8:59
immu521-Jul-10 8:59 
GeneralRe: Java script reset problem Pin
Not Active21-Jul-10 9:26
mentorNot Active21-Jul-10 9:26 
QuestionASP.NET Crystal Report Issue Pin
Hema Bairavan21-Jul-10 1:31
Hema Bairavan21-Jul-10 1:31 
AnswerRe: ASP.NET Crystal Report Issue Pin
Ennis Ray Lynch, Jr.21-Jul-10 4:00
Ennis Ray Lynch, Jr.21-Jul-10 4:00 
QuestionConnect to ms-sqlserver by using ADO.Net Pin
kimvisal21-Jul-10 0:20
kimvisal21-Jul-10 0:20 
AnswerRe: Connect to ms-sqlserver by using ADO.Net Pin
Ankur\m/21-Jul-10 1:10
professionalAnkur\m/21-Jul-10 1:10 
AnswerRe: Connect to ms-sqlserver by using ADO.Net Pin
Sandeep Mewara21-Jul-10 5:45
mveSandeep Mewara21-Jul-10 5:45 
AnswerRe: Connect to ms-sqlserver by using ADO.Net Pin
Prosanta Kundu online21-Jul-10 19:18
Prosanta Kundu online21-Jul-10 19:18 
QuestionWhile Loop Problem in SQL Pin
jintalPatel20-Jul-10 22:46
jintalPatel20-Jul-10 22:46 
AnswerRe: While Loop Problem in SQL Pin
Panchal Hardik21-Jul-10 1:08
Panchal Hardik21-Jul-10 1:08 
Questionajax tool Pin
Thanusree Duth20-Jul-10 20:58
Thanusree Duth20-Jul-10 20:58 
AnswerRe: ajax tool Pin
Tej Aj20-Jul-10 21:38
Tej Aj20-Jul-10 21:38 

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.