how to store document into sql Server's blob
-
:zzz: hi friends, any one please help me about how to store a word document in sql server's blob.
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. -
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.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.
-
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.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.
-
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.
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.