How to upload .doc file into DataBase(SQLSERVER2005) and how to retrive it from DB

  • 12 years ago

    Hi 2 all,

              How to upload .doc file into DataBase(SQLSERVER2005) and how to retrive it from DB

    and i want it in Windows Application c# only...not in Web...

    i know this in Web using FileUpload Control...so, i want it in Windows only..... 

    Ex : if i take one Resume...then how can i save this doc into DB and how to retrive it from DB again....

     

    Please help me..................it's very urgent..........

     

    Thanqqqqqqqqqqqqq
     

  • 12 years ago
    Load the .doc file into filestream then using StreamReader convert into byte[], store it in DB in text datatype
  • 12 years ago

    This article shows you what you need to do.

    http://support.microsoft.com/kb/308042

    In the section where the filestream is created during the file upload, the location of the file is hard-coded. If you want the user to be able to select a file, you can use the OpenFileDialog control on your form.

    http://msdn.microsoft.com/en-us/library/7684e2s0.aspx

     

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Linux is only free if your time has no value” - Jamie Zawinski