DatabaseColumn.PictureValue

From Xojo Documentation

Revision as of 16:20, 29 October 2019 by PLefebvre (talk | contribs) (Sample Code)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!
Method

DatabaseColumn.PictureValue() As Picture

New in 2019r2

Supported for all project types and targets.

Gets the Picture value for the column.


Method

DatabaseColumn.PictureValue(format As Picture.Formats, quality As Integer = Picture.QualityDefault, Assigns value As Picture)

New in 2019r2

Supported for all project types and targets.

Sets the Picture value for the column.

Notes

For situations where you need to set a database column to NULL, you should use the Value property like this:

rs.EditRow
rs.Column("MyIntegerColumn").Value = Nil // sets to NULL in the database
rs.SaveRow

Sample Code

Get the picture value of a column in a RowSet:

// rs is a RowSet with an picture column called "Photo"
Var photo As Picture
photo = rs.Column("Photo").PictureValue

Set the picture value of a column in a RowSet:

// rs is a RowSet with an picture column called "Photo" and MyPhoto is a picture:
rs.EditRow
rs.Column("Photo").PictureValue(Picture.Formats.PNG) = MyPhoto
rs.SaveRow