Showing PDF documents from a SQL Database

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Re: Showing PDF documents from a SQL Database

    This is just off the top of my head, so let me know if it doesn't work. Be
    gentle <grin>

    Once you have the pdf bytes from the database, something like this *should*
    work

    byte[] bytes = GetPdfBytes(); //your function that gets the bytes from sql
    server
    Response.ContentType = "application/pdf"; //you may need to check the
    exact Mime type of a pdf doc
    Response.OutputStream.Write( bytes, 0, bytes.Length );
    Response.End();

    Cheers!
    Dave
    [url]www.aspNetPOP3.com[/url]
    "Chris Roden" <croden@sterlingcapital.com> wrote in message
    news:052101c3410a$81453260$a501280a@phx.gbl...
    > I have PDF documents stored in a SQL Database. How can I
    > display the PDF document straight from the database
    > without creating a file?
    >
    > Chris Roden
    >

    dave wanta Guest

  2. Similar Questions and Discussions

    1. Showing the email link from a database link
      Hi Does anyone know how to have an email link show when showing the databse info in a repeating table. Here is the link...
    2. Database Tables Not Showing
      :confused; I am following the Tutorial for setting up the PHP/SQL GlobalCar Dynamic Page. Everything has gone fine until I got to Getting...
    3. Coverting Indesign 2.0 documents to Microsoft Word xp documents
      How would you go about converting indesign documents to microsoft word documents? Is there a way to convert them? Thanks for any help that you can...
    4. Desperate to convert Word documents into PDF documents
      This describes my problem. I have Windows XP Home and Word 2002. The problem seems to have begun to occur after I downloaded updates to 5.0 from the...
    5. accessing documents in "My Documents"
      Type taking ownership in help. -- http://www.smh.com.au/news/opinion/webdiary/index.html...
  3. #2

    Default RE: Showing PDF documents from a SQL Database

    Hello Chris,

    For how to get binary data from SQL server, you could refer to KB article:
    "HOW TO: Read and Write BLOB Data by Using ADO.NET Through ASP.NET"

    If there is anything unclear, please feel free to post here.

    Best regards,
    yhhuang
    VS.NET, Visual C++
    Microsoft

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Got .Net? [url]http://www.gotdotnet.com[/url]
    --------------------
    !Content-Class: urn:content-classes:message
    !From: "Chris Roden" <croden@sterlingcapital.com>
    !Sender: "Chris Roden" <croden@sterlingcapital.com>
    !Subject: Showing PDF documents from a SQL Database
    !Date: Wed, 2 Jul 2003 19:26:27 -0700
    !Lines: 6
    !Message-ID: <052101c3410a$81453260$a501280a@phx.gbl>
    !MIME-Version: 1.0
    !Content-Type: text/plain;
    ! charset="iso-8859-1"
    !Content-Transfer-Encoding: 7bit
    !X-Newsreader: Microsoft CDO for Windows 2000
    !Thread-Index: AcNBCoFFPLYeHP4CSNO/YIiiEFuC2w==
    !X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    !Newsgroups: microsoft.public.dotnet.framework.aspnet
    !Path: cpmsftngxa09.phx.gbl
    !Xref: cpmsftngxa09.phx.gbl microsoft.public.dotnet.framework.aspnet:31912
    !NNTP-Posting-Host: TK2MSFTNGXA13 10.40.1.165
    !X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    !
    !I have PDF documents stored in a SQL Database. How can I
    !display the PDF document straight from the database
    !without creating a file?
    !
    !Chris Roden
    !
    !

    Yan-Hong Huang[MSFT] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139