954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Storing Data from different file formats to a Database

Hi Friends,
I am new to VB.Net 2005.I need to create a program which will store data from text files,word documents,excel files,xml files to a database.Can anyone help me.it is urgent.Thank you.

Programmer666
Newbie Poster
5 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 

If using SQL Server create an Image or nVarChar field in your database table to hold the data. The process is not that different from storing a picture so this code should help a lot. You will basically choose a file, open it as a FileStream and read it into a buffer that you will upload to the database. You can even use the built-in compression processing by pushing it through a GZipStream. Also store the original filename and you can pull it back out and reconstitute the file easily.

bwkeller
Junior Poster in Training
52 posts since Feb 2008
Reputation Points: 12
Solved Threads: 6
 

You might find this code easier to understand as it is not ASP code.

bwkeller
Junior Poster in Training
52 posts since Feb 2008
Reputation Points: 12
Solved Threads: 6
 

Thanks Bwkeller, But perhaps I wasnt clear enough.I have data in a text files,Excel Files ,Word Document .Its like it has details of peoples are in the files like Name,Address,Phone Number,Age ,DOB.I need to take the data's from ,text files and Excel Files,Word Documents . I need put those data's from these different types of file in a database.Hope I am able to explain what I want.

Programmer666
Newbie Poster
5 posts since Mar 2008
Reputation Points: 10
Solved Threads: 0
 
Thanks Bwkeller, But perhaps I wasnt clear enough.I have data in a text files,Excel Files ,Word Document .Its like it has details of peoples are in the files like Name,Address,Phone Number,Age ,DOB.I need to take the data's from ,text files and Excel Files,Word Documents . I need put those data's from these different types of file in a database.Hope I am able to explain what I want.

Well that is a different matter. You would have to look up the different APIs for the different file formats. This is how to read Word files with C# which can be converted to VB.NET here. This code reads Excel files using VB.NET and text files can be read pretty natively with VB.

bwkeller
Junior Poster in Training
52 posts since Feb 2008
Reputation Points: 12
Solved Threads: 6
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You