Opening a PDF ASP.NET "file is damaged and cannot be opened"

I pulled a PDF and other documents from the database after performing an upload and when I attempted to open the document on a web page I got "file is damaged and cannot be opened."  Well after digging around I found that the Table Adapter in .NET create the stored proc pamarmeter as binary with the BLOG provider type (which was correct) but it defaulted the size to 65k.  I keyed -1 in the size and that changed the parameter to the max size as shown below with DBType as Object.  Basically the document was getting truncated when loaded from the disk to the database.  

 

Comments are closed