Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
How to store Word files into Sql Server 2005 database in Windows application. Say I need to store the file when one clicks in a button.

Thanks in advance
Posted
Updated 17-Dec-09 11:34am
v2

You store it as a blob, and you retrieve it and then write the byte array you got back to the hard drive, then you can open it.
 
Share this answer
 
Create a table with a field of type Image.

CREATE TABLE files
(
id int IDENTITY NOT NULL,
filebytes image
)

Now follow the steps mentioned here
Store image in Database[^]

You dont need to hesitate about Image. You can store any file in Image DataType. Just put Byte Array of the file content.

For security, store the filename and Mime Type of the file with the same record.

Cheers. :rose:
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900