Select from following answers:- By setting its Connection property to read binary data
- By calling the ExecuteNonQuery method and reading the results into a BinaryReader
- By calling the ExecuteReader method and casting the DataReader to a BufferedStream
- By setting the CommandBehavior to SequentialAccess in the ExecuteReader methods constructor
- All Above
The default behavior of the DataReader is to load incoming data as a row as soon as an entire row of data is available. Binary large objects (BLOBs) need to be treated differently, however, because they can contain gigabytes of data that cannot be contained in a single row. The Command.ExecuteReader method has an overload which will take a CommandBehavior argument to modify the default behavior of the DataReader. We can pass CommandBehavior.SequentialAccess to the ExecuteReader method to modify the default behavior of the DataReader so that instead of loading rows of data, it will load data sequentially as it is received. This is ideal for loading BLOBs or other large data structures.
Show Correct Answer
Asked In: Many Interviews |
Alert Moderator