Solved

Thread was being aborted

Posted on 2009-07-05
2
323 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
2 Comments
 
LVL 9

Accepted Solution

by:
Rahul Goel 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
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 goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
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.

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now