New Members FAQ
Save file in daabase using vb.net
14 Nov 2011
anyone know the code to save the file (.txt,.pdf) in the database (i'am using sql server 2005) and using language vb.net.. not only save the path of the file, but save the file also in the database..
Date: 14/Nov/2011 Rating:
I am not sure if its good idea to store the file content in database but if it is requirement then it is fine to store.
I believe you have the column defined to store the data.
First thing, either you are using ADO.net or Entity Framework for the database, you should read the file.
Read the File
StreamReader read = new StreamReader("C:\\stp.log");
String content = read.ReadToEnd();
content has all the contents, now you can insert that into your database. I am giving snippet not whole code
insert into TextData(Data) values (content)
"Please don't forget to Rate this answer if you found it usefull"
This thread is locked for new responses. Please post your comments and questions as a
If required, refer to the URL of this page in your
How to retain the httpwebrequest state
Problem obtain detailsview control value
Return to Discussion Forum
Post New Message
no of click on advertisement in asp.net application
Please Please help.................. tooo urgent
Please tell me .Net interview Questions for 2+ Years Exp
To upload Documents like(doc,pdf,etc) to file system
Naved Hasan ...
Last 7 Days
Awards & Gifts
Articles Rss Feeds
Forum Rss Feeds
Talk to Webmaster Tony John
Revenue Sharing sites
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2013 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.