memory-stream

Deserialization throws an exception for this bit of C# code

Edit: Closing this because i've found the reason why it's erroring, but instead of removing this post .. i generate a newer post with a more refined question. Hi folks, i have some binary data i've read in. i wish to convert it to an System.Drawing.Image, so i create an instance of an Image object, using a memory stream as the input ...

How to set the name of the file when streaming a Pdf in a browser?

Not sure exactly how to word this question ... so edits are welcomed! Anyway ... here goes. I am currently use Crystal Reports to generated Pdfs and just stream the output to the user. My code looks like the following: System.IO.MemoryStream stream = new System.IO.MemoryStream(); stream = (System.IO.MemoryStream)this.Report.ExportTo...

C# 3.0 - How can I save a file to database from a MemoryStream?

Hi everyone! I'm trying to save a PDF file to SQL Server and I already have a method that generates a PDF but is opens a window showing this file. But, now I have to generate a PDF, but it must be saved to database in a image field. And I have to save this file from a MemoryStream object that I get ready to be saved, showed etc. I ha...