First thing to understand: PDF is not a part of W3 standards (and I think it's good), so you cannot do anything to show a PDF file, it remains the problem of client part. Some browsers will be set up to show PDF as pages in browser (usually, with some browser plug-in), some won't. You should not make any assumptions on that. You cannot assume that any PDF-related software even exists on the client system. And that is not a problem at all. Depending on browser settings, PDF file will be shown or the user will be suggested to save the file, so the user can always open it later.
Storing of the PDF files in database is not the best option, because, from the database standpoint, it is something unstructured, so you would need to store it as a blob. In Web site settings, it's usually better to store files in the file system of the server's host, in the directory of the site, based on one or another system of unique names; which better should be simple file names, or relative paths. In this approach, the database will store just the file names.
Storing the files themselves in the database is also an option, which I did not recommend. It's no different from storing any other files, such as pictures, audio, video files and other media files, and a lot more. It would be bad to answer related question again and again; it was answered too many times before:
http://www.codeproject.com/search.aspx?q=%28%22.NET%22+OR+%22C%23%22%29+database+%28image+OR+images+OR+bitmap+OR+bitmaps%29&doctypeid=1%3b2%3b3%3b13%3b14[
^].
Now, if you store just the file names; and the files are in your site's directory, all you need to deliver the file to the user is to generate HTML fragment like this:
<a href="yourFile.PDF">Your PDF document</a>
If you store files in the database, not just file names (again, I would not recommend it), you have two options: 1) create a temporary file and reference it; 2) have the ASP.NET page which provides the file content dynamically in HTTP response; you can reference this page in the link anchor or request in any other way. In second case, most important thing is to generated correct
Content-type HTTP header, which should be "application/pdf". Content types are standardized and maintained by IANA; please see:
https://www.iana.org/assignments/media-types/media-types.xhtml[
^];
see also:
https://en.wikipedia.org/wiki/Media_type[
^]
https://en.wikipedia.org/wiki/Internet_Assigned_Numbers_Authority[
^],
https://en.wikipedia.org/wiki/MIME[
^].
[EDIT]
In addition, to reply the follow-up question asked in the comments to this answer:
There is nothing to show in option #1. Just do it.
For #2, see, for example,
https://msdn.microsoft.com/en-us/library/system.web.httpresponse.contenttype%28v=vs.110%29.aspx,
https://msdn.microsoft.com/en-us/library/system.web.httpresponse%28v=vs.110%29.aspx.
The code samples shown in these MSDN pages also explains how to generate the HTML code referencing a file. "Save file" is really nothing, the usual file operation; it all depends on where you get a PDF file. Or you can replace the hard-coded file name with appropriate ASP.NET syntax, such as Razor
http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx[
^].
It depends on how you use ASP.NET, what
view engine. I really hope this is all you need, because explaining further detail would take as much as answering the question "how to use ASP.NET". :-)
—SA