Working with Binary (BLOB) Data

A common task I'm often asked about is how to read and write binary data—typically representing a graphical image—using the ADO.NET classes. As most ADO.NET articles and books don't seem to cover this important task, I'll use this chapter's first section to illustrate two distinct ways to work with stored binary data—one with the DataReader class and the other with the DataSet class. I'll also explore the use of “chunking” to facilitate working with very large amounts of binary data in an efficient manner. The section concludes with a demo application that allows you to view the images stored for a sample database and update the database with any other image stored in the file system.

Using the DataReader Class ...

Get Extending MFC Applications with the .NET Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.