Solved

Thread was being aborted

Posted on 2009-07-05
2
327 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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Securing WEBAPI on Azure 2 55
Connect Gridview column to Textbox in C# 2 54
.NET Core supports which cell phone platforms? 3 34
JVM error from eclipse 1 25
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This video teaches viewers about errors in exception handling.
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.

737 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