Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to store document into sql Server's blob

how to store document into sql Server's blob

Scheduled Pinned Locked Moved ASP.NET
databasesql-serversysadminhelptutorial
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kpsetty
    wrote on last edited by
    #1

    :zzz: hi friends, any one please help me about how to store a word document in sql server's blob.

    M 1 Reply Last reply
    0
    • K kpsetty

      :zzz: hi friends, any one please help me about how to store a word document in sql server's blob.

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Hi there, Basically, you can use the image type in SQL to store the content of a word document, however, I assume that you should have a solid reason such as replication ... to decide to save the word document in SQl rather than save it to disk and simply persist the path of the file in DB. You can use the ADO.NET[^] to write the content of the word document to SQL, here is an example: Writing BLOB Values to a Database [^] There are also lots of sample code out there, simply google for it.

      K 2 Replies Last reply
      0
      • M minhpc_bk

        Hi there, Basically, you can use the image type in SQL to store the content of a word document, however, I assume that you should have a solid reason such as replication ... to decide to save the word document in SQl rather than save it to disk and simply persist the path of the file in DB. You can use the ADO.NET[^] to write the content of the word document to SQL, here is an example: Writing BLOB Values to a Database [^] There are also lots of sample code out there, simply google for it.

        K Offline
        K Offline
        kpsetty
        wrote on last edited by
        #3

        hi there, Thanks for ur reply,may i know how to retrieve and show. my requirement is list the document names in the datagrid, if the user click the name of the document then the document open in MSWord, i had done the listing in datagrid job.i want to know how to open.

        M 1 Reply Last reply
        0
        • M minhpc_bk

          Hi there, Basically, you can use the image type in SQL to store the content of a word document, however, I assume that you should have a solid reason such as replication ... to decide to save the word document in SQl rather than save it to disk and simply persist the path of the file in DB. You can use the ADO.NET[^] to write the content of the word document to SQL, here is an example: Writing BLOB Values to a Database [^] There are also lots of sample code out there, simply google for it.

          K Offline
          K Offline
          kpsetty
          wrote on last edited by
          #4

          hi there, Thanks for ur reply,Even i found how to retrieve but i don't know how to show.my requirement is,listing the document names in the datagrid, if the user click the name of the document then the document open in MSWord, i had done the job oflisting in datagrid.i want to know how to open.

          1 Reply Last reply
          0
          • K kpsetty

            hi there, Thanks for ur reply,may i know how to retrieve and show. my requirement is list the document names in the datagrid, if the user click the name of the document then the document open in MSWord, i had done the listing in datagrid job.i want to know how to open.

            M Offline
            M Offline
            minhpc_bk
            wrote on last edited by
            #5

            Hi there, You can check out the link[^] to see how to retrieve binary data from DB. Also, there are lots of recources out there. To send the MS word document to the client side, you'll have two options here IMO: + You can save it to disk and simply use a link to point to the file. + You can write out the binary data of the file to the output stream of the Response object.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups