Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi !

I want to store a file (doc,pdf,...) in SQL Server 2005 database .
How to do it ?

Please send to me a sample code .

Thanks .
Posted

 
Share this answer
 
Comments
walterhevedeich 23-Aug-11 21:38pm    
Nice article.
You have two (or more, I don't know) options:
  • Store the whole file content as a binary object (BLOB) inside the database ('deep copy').
  • Store just the file path inside the database ('weak copy').
 
Share this answer
 
Comments
Pravin Patil, Mumbai 23-Aug-11 8:07am    
My 5 for the most correct answer......
CPallini 23-Aug-11 8:10am    
Thank you.
Yuri Vital 23-Aug-11 10:21am    
Yes it's a good answer !!
walterhevedeich 23-Aug-11 21:38pm    
Correct. My 5. Small files - deep copy. Large files - weak copy.
CPallini 24-Aug-11 3:15am    
Thank you.
See this answer. Images, files, all the same really. If you've got large files consider using streaming instead of the byte array approach suggested here.

Store images in sql server[^]
 
Share this answer
 
follow the belowing link........
http://support.microsoft.com/default.aspx?scid=kb;en-us;317016

Edit: URL formatted.
 
Share this answer
 
v2

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