locked
extract PDF's from SQL database using C# RRS feed

  • Question

  • What is the best way to extract 60000+ binary files from a SQL 2008 R2 database using C#. the data is stored as "Image" data type. they are mostly PDF's.

    Devon Quick

    Wednesday, August 22, 2012 5:39 PM

Answers

  • Store your pdf as a blob, make a select statement for return this blob, fill a byte[], and then convert it into PDF.

    Edit: Additional info, if you want to know how to convert byte[] into a file like jpg,pdf, etc, check this link


    Web Developer


    • Edited by Norkk Wednesday, August 22, 2012 6:21 PM
    • Proposed as answer by Mike Dos Zhang Friday, August 24, 2012 6:00 AM
    • Marked as answer by Mike Dos Zhang Friday, August 24, 2012 6:00 AM
    Wednesday, August 22, 2012 5:47 PM

All replies

  • Store your pdf as a blob, make a select statement for return this blob, fill a byte[], and then convert it into PDF.

    Edit: Additional info, if you want to know how to convert byte[] into a file like jpg,pdf, etc, check this link


    Web Developer


    • Edited by Norkk Wednesday, August 22, 2012 6:21 PM
    • Proposed as answer by Mike Dos Zhang Friday, August 24, 2012 6:00 AM
    • Marked as answer by Mike Dos Zhang Friday, August 24, 2012 6:00 AM
    Wednesday, August 22, 2012 5:47 PM
  • hi , please i have the same problem but in addition i want to display the pdf with the adobepdf reader

    how can i do this ! ?

    and another point:i would creating the file each time i convert the bytes to file and save it in the folder of my project windowform!

    please help !! 

    thnx in advance 

    Tuesday, June 5, 2018 2:29 PM