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.

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.

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.

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.

This article has been dead for over six months. Start a new discussion instead.