Solved

Thread was being aborted

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

828 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