locked
retrieve a word file from sql server using c# RRS feed

  • Question

  • hi..

    Im doing a small work in which i need to store and  retrieve the word file in the sql server database using c# in winforms..i found how to store it in the database but i dont know how to retreive in c# winforms..
    someone help me in this issue..
    Wednesday, December 9, 2009 10:09 AM

Answers

  • I guess as u are using SQL Server as DB, u might be using RAW type Column to Store the File into DB.

    To Insert any data into RAW column best possible way will be Convert Data into bytes and then write Byte
    into RAW Column of DB.

    The fetching goes in smilar manner a simple SELECT statement fetches the RAW column contents into DataTable/DataRow etc
    which will be of type object.

    Now u need to Convert Object to Bytes. That way u get the File back.
    .NET Maniac -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
    • Proposed as answer by Geert van Horrik Friday, December 11, 2009 9:01 AM
    • Marked as answer by Bin-ze Zhao Monday, December 14, 2009 4:54 AM
    Wednesday, December 9, 2009 10:20 AM