June 2003
Intermediate to advanced
800 pages
34h 20m
English
You want to bind a PictureBox to a field that contains binary image data.
React to the Format data-binding event, and convert the binary data to an Image object.
You can use data binding to bind any property from almost any control to a database field, including the Image property from the PictureBox control. However, the Image property requires an Image object—not just a byte array. Therefore, you need to perform some conversion to translate the binary data into an Image object.
You can use data-binding events to execute this conversion logic automatically. All you need to do is react to the Format event (first introduced in recipe Format Data-Bound Fields) and create a new Image object ...
Read now
Unlock full access