Solved

Thread was being aborted

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

707 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

12 Experts available now in Live!

Get 1:1 Help Now