Using DataReader to Retrieve BLOB Data

Occasionally, you will need to retrieve a BLOB from a database. A BLOB is a mass from outer space that grows proportionally to the number of people it devours. It is also a block of data that, as far as the database is concerned, contains no structure. The acronym BLOB stands for Binary Large OBject. Typically, images, files, and other such data is stored in BLOBS. DataReaders can be used to retrieve BLOBS as Listing 19.10 illustrates.

Listing 19.10. Retrieving BLOB Data from a Database
1: program readblob; 2: 3: {$APPTYPE CONSOLE} 4: 5: {%DotNetAssemblyCompiler 'c:\windows\microsoft.net\framework\v1.1.4322\System.Data.dll'} 6: 7: uses 8: SysUtils, 9: System.Data, 10: System.Data.SqlClient, 11: System.IO; ...

Get Delphi for .NET Developer’s Guide 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.