Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Covert to Binary Object

Status
Not open for further replies.

Ramo83

Programmer
Apr 7, 2005
20
IE
Hello,
I have files objects of type: FileInfo, and I need to change them to a Binary Object format so I can put them in a database...
How can that be done please?
Thank you
 
Are you trying to put the contents of the file into the database, or the FileInfo object?

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Yes I'm trying to put the content of the file in the database. So I have to change the Fileinfo to a Binary Object (Sql Data type)...
Thanx for the help
 
A FileInfo is just information about a file (size, date created, etc).

In order to read the contents of the file, you'll need to use one of the Stream objects, followed by one of the Reader objects.

FileStream -- supports random access to a file.
BinaryReader -- Read binary information from a stream.
TextReader -- Read strings from a stream.

If you have the MSDN documentation installed on your machine, paste this link into the navigation textbox:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2005JAN.1033/cpguide/html/cpconBasicFileIO.htm

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top