?
Solved

Thread was being aborted

Posted on 2009-07-05
2
Medium Priority
?
329 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 2000 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

770 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