Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

PDF File Issue

  • Please log in to reply



    New Member

  • Member
  • Pip
  • 1 posts
I have stored my PDF files in the database as binary code.
Now i want to retriee the the binay format file and want to display to my user.
But when ever i have tried the file is not visible. Why? Any help..
Your help highly appriciated!I have written below code..

Basically i want to show the report to the user, I like to store in memory rather physically storing the report in hard drive.
Or do we have any better way to display the report to my user from database (But constraint is File should show in PDF format only!)

string strString= "Select Image From ImageTable where ID=1"
SqlConnection connection = new SqlConnection(connectionstring);
SqlDataAdapter da = new SqlDataAdapter(strSpName, connection);
da.SelectCommand.CommandType = CommandType.Text;

DataSet ds = new DataSet();

// Fill dataset

if (ds.Tables[0].Rows.Count > 0)


byte[] Myimage= new byte[0];
DataRow dr;

Myimage = (byte[])dr["NoticeImage"];
int ArraySize = new int();
ArraySize = Myimage.GetUpperBound(0);

FileStream fs = new FileStream(@"C:\Temp\image.pdf", FileMode.OpenOrCreate, FileAccess.Write);
fs.Write(Myimage, 0,ArraySize);
File.Open(@"C:\Temp\image.pdf", FileMode.Open);

  • 0




    Member 1K

  • Member
  • PipPipPipPip
  • 1,382 posts
Hi sreeni2219,

PDF files are encoded in RSA with a 128-bit key, and only Adobe products can propely read, write or view it to it, since the format is registered to them and they have the 128-bit key. So, in your app. all your user will see is a bunch of binary code.

Crystal Reports is widely used for reports in the industry, also it comes built-in with Visual Studio.NET
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP