Hi Get link Facebook X Pinterest Email Other Apps - June 26, 2016 HiCan you tell me someone how can i save Picture from TImage to SQL Table (SQL Field is Image) in Delphi XE 8 Get link Facebook X Pinterest Email Other Apps Comments Jude De SilvaJune 26, 2016 at 3:15 AMThanksReplyDeleteRepliesReplybaeckergJune 26, 2016 at 8:23 AMDid you try:TBlobField(TSTUBasic.FieldByName('STUPhoto')).LoadFromStream(ms)You need to load the picture to a MemoryStream first - works for meReplyDeleteRepliesReplyOliver MünzbergJune 26, 2016 at 8:57 AMbaeckerg That is all done in TBlobField.Assign/AssignTo - just use it - do not repeat code over and over again - we call it DRYThis simple line of code will do everything you need TSTUBasic.FieldByName('STUPhoto').Assign( STUImage.Picture.Graphic );Internally it will copy the data into a memory stream and load this stream into the blob field.ReplyDeleteRepliesReplyAdd commentLoad more... Post a Comment
Thanks
ReplyDeleteDid you try:
ReplyDeleteTBlobField(TSTUBasic.FieldByName('STUPhoto')).LoadFromStream(ms)
You need to load the picture to a MemoryStream first - works for me
baeckerg That is all done in TBlobField.Assign/AssignTo - just use it - do not repeat code over and over again - we call it DRY
ReplyDeleteThis simple line of code will do everything you need
TSTUBasic.FieldByName('STUPhoto').Assign( STUImage.Picture.Graphic );
Internally it will copy the data into a memory stream and load this stream into the blob field.