Solved

Thread was being aborted

Posted on 2009-07-05
2
328 Views
Last Modified: 2012-06-27
I have implemented the solution as indicated but can't seem to find the code block that is generating the error.

Are you able to check this code and see where this exception is occurring. It could be something quite simple. Its been a long day.

Thanks
sqlr = cmd.ExecuteReader();
                while (sqlr.Read())
                {
                    if (!sqlr.IsDBNull(0) && !sqlr.IsDBNull(1))
                    {
                        bytDocument = (byte[])sqlr["SupportingDocument"];
                        strExt = sqlr.GetString(1).ToLower();
                    }
                    else
                    {
                        //My messages here
                        return;
                    }
                }
            sqlr.close();
strFileName = "test";
Response.Clear();
                             //   Response.ContentType = "application/octet-stream";
                           switch (strExt.ToUpper())
                           {
                               case "PDF":
                                   Response.ContentType = "application/pdf";
                                   break;
                               case "JPG":
                           }
 
                            //Tell browser to save rather than display inline.
                           Response.AppendHeader("Content-Disposition", "attachment; filename=" + strFileName+strExt);
                           Response.AddHeader("Content-Length", myFile.Length.ToString());
                           Response.BinaryWrite(bytDocument);
                           Response.Flush();
                           Response.End();
}
            catch (Exception)
            {
                     //Show processing error
            }
            finally
            {
                cn.Close();
            }

Open in new window

0
Comment
Question by:JenebyM
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

by:
Rahul Goel ITIL earned 500 total points
ID: 24782990
Take your
 Response.AppendHeader("Content-Disposition", "attachment; filename=" + strFileName+strExt);
Response.AddHeader("Content-Length", myFile.Length.ToString());
Response.BinaryWrite(bytDocument);
Response.Flush();
Response.End();

Statements out of try catch clock

 
0
 

Author Closing Comment

by:JenebyM
ID: 31600037
Ok , Thanks.

This closes the question. Thanks for helping a very tired mind.

Regards
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question