Display SQL Word VARBINARY(MAX) Binary Document in Visual Studio Form

I'm working on a proof-of-concept idea for my boss to show him that we can suck in Word documents (resumes) and other binary data (pictures) into an SQL Server then display the data and maybe search on the text.

I have an SQL 2008 Server with a test table where I created some VARBINARY(MAX) fields -- one for a picture and one for a Word document.  I founds some code to insert a row and populate the respective fields from respective file sources (a picture of me and my resume in Word).

I'm using Microsoft Visual Studio Express 2012 for Windows Desktop.  I created a Windows Forms Application/Visual Basic sample form where I dropped some text and the picture image field on the form from the SQL DataSet.

What I don't know how to do is display the Word document from the VARBINARY(MAX) field.  If I display it as a RichTextBox, it only shows "Byte[] Array".

Is there some type of Custom Control I need to add for this data type?  If so, where can I find one and how do I add it?

Thanks in advance!
wchestnutAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim P.Commented:
This is a very, very bad idea. You should never store binary data inside a database. The files should be stored on disk and then create a pointer to the file in the DB.

If you want to create a table that has the path and then keywords from the resumes that is the best option.

The size of the DB will quickly get out of hand, the retrieval will be slow, the restores are hard because of the size and the possibility of data corruption is very possible.
0
wchestnutAuthor Commented:
Yeah, I get your point.  It would be nice to have but probably not very practical.

We've actually talked about this internally since my original post.  What we really want to do now is be able to import only the text from a Word document in for text searches.  Is there something that already exists (3rd-party tools) that can scan a primary and all subfolders for Word documents, open them, import the text and include other data like the file name, file date, containing folder, etc.?
0
Jim P.Commented:
I don't know of any off hand. I would build something on my own though.

This should actually be very easy to program up with VBA which is included with the Office suite. I'd recommend using Access to do the programming because it has the forms and wizards to help build a front end a lot easier than using something like Word.  It also has the connectivity to SQL Server sort of built in.

If you don't have much experience with it we have enough experts that can probably walk you through the whole process.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wchestnutAuthor Commented:
Yeah, I already started creating some VBA code in a Word document which opens a Word document then saves it as a text file.  I think I'm going to have it Select All, Copy then take the contents from the Clipboard and push it up to SQL and add a Row in a Table.  That way I don't have a trail of TXT files all over our file server.  And, I might just take your idea and move it to Access.

Thanks, jimpen!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.