Click here to Skip to main content
14,695,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi...
i having a upload control from which i will select files.
on insert button click i need to insert these upload files into database
on retrieve button click i should retrieve the files

thanks in advance
Posted

Have a look at these articles to get an idea and get started.
Save and Retrieve Images from the Database using ASP.NET 2.0 and ASP.NET 3.5[^]
Save and retrieve image from SQL 2005 in ASP.Net[^]
Save & Read Image From Database[^]

Do post a question with specific issue, if you get stuck.
   
Comments
07405 14-Jul-12 6:20am
   
these links is for inserting image no, if it is a file ex .doc ,.docx, .xls
how can we do it?
Sandeep Mewara 14-Jul-12 6:39am
   
Same logic! Did you try ?
07405 14-Jul-12 6:44am
   
yes i tried it in table it is taken as image as type
Sandeep Mewara 14-Jul-12 6:55am
   
Expecting a spoon feed?

All you need is to have different datatype in databse if storing file over there. If location path then no change.
Next, you just need to change any code related to image any where.

Try!
Please find the attached project in the below path.
http://www.c-sharpcorner.com/Forums/Thread/179342/how-to-upload-and-retrieve-files-from-database.aspx[^]



Here is the my table script.

create table uploadtest
(
id int primary key,
filename varchar(500),
filecontent varbinary(max)
)

For demo purposes i have set to upload and download one file only.

Also i have used Entity framework, if you are using stored procedures, create a class with the above columns as properties and set the values or directly pass the stored proc content to filename and file content

Please dont forget to mark my answer as accepted if it works.
   

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