473,387 Members | 1,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Dynamic DB pdf forms issue

gchq
96
Hi there

VB.NET Web app

Using a 'viewing page' I can pull a pdf file from the DB on the Development W/Station, but on the server it displays a blank page... As images are also stored in the same DB and relative directory, and are no problem, the issue can't be down to a path!

Here is the code

Expand|Select|Wrap|Line Numbers
  1. Imports System.Data
  2. Partial Class Document_Viewer
  3.     Inherits System.Web.UI.Page
  4.     Private strSQL As String
  5.     Private vData As DataConn
  6.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  7.  
  8.  
  9.         Dim vID As String = Request.QueryString("Document_ID")
  10.         If Not IsNumeric(vID) Then
  11.             Exit Sub
  12.         End If
  13.  
  14.         strSQL = "SELECT Document_PDF FROM Documents WHERE Document_ID = " & vID
  15.         vData = New DataConn
  16.         Dim vDocument As Byte()
  17.         Try
  18.             vDocument = vData.ExecuteScalar(CommandType.Text, strSQL)
  19.         Catch ex As Exception
  20.             EmailError(ex.Message, "23")
  21.             Exit Sub
  22.         End Try
  23.         Response.ClearHeaders()
  24.         Response.AddHeader("content-disposition", "inline=" & vDocument.ToString())
  25.         Response.AddHeader("content-length", vDocument.ToString())
  26.         Response.ContentType = ("application/pdf")
  27.         Response.BinaryWrite(vDocument)
  28.  
  29.     End Sub
  30.  
  31.  

The server is W2K as is the workstation and both are running .NET 2.0 Framework.

Any ideas where to look?

Thanks
Dec 6 '08 #1
0 885

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Scott | last post by:
Relative newbie here, I'm looking to display the value of radio buttons and check boxes on the page before submission. So far I can do most of it. When "Hat" is checked there are to be no color...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
3
by: MikeY | last post by:
Hi Everyone, I am working in C#, windows forms.My question is this. All my button dynamic controls properties are present and accounted for except for the"FlatStyle" properties. I can't seem to...
21
by: Marky C | last post by:
atof is not working. double a = atof("12.345"); a gets set to 12.000 I am working on a toshiba micro. The data map has no space allocated to it for dynamic memory. Does anyone have an...
6
by: MikeY | last post by:
Hi Everyone, Does anyone know where I can get my hands on a sample with source code of a simple dynamic button control in C# Windows form. I am looking for a sample that uses a class library...
1
by: Don Hames | last post by:
I have a windows application that has a split container in the client area. In the left panel, I added controls via the designer in VS 2005. In the right panel, I want to dynamically create and...
4
by: Bhavin | last post by:
How can I capture user entered values from dynamically created controls in ASP.NET ? Thanks,
7
by: AdeelAlvi | last post by:
iam working on a project called service desk that automates the departmental services online .one major component i have to create is that to convert paper based forms into dynamic webforms . i...
3
by: RahimAsif | last post by:
I am writing an application that requires the a portion of the main menu to be dynamic. The menu has file, panels, view files and help across the top. The view files sub menu needs to be...
2
by: rob.horvath | last post by:
Ok, I'm having what is most likely a very newbie problem, but... I am generating dynamic content for a page within a DIV on my main page (so I have a 'content' DIV). This works very well, and all...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.