Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » HowTo bind StaticImage to SQL
Re: HowTo bind StaticImage to SQL [message #43615 is a reply to message #43611] Sat, 13 September 2014 22:26 Go to previous messageGo to previous message
Didier is currently offline  Didier
Messages: 736
Registered: November 2008
Location: France
Contributor
Hello Jerson,

To put images in SQL I use this:
//========================================
//          IMAGES
// ========================================
TABLE_(IMAGES)
	INT_	(IMG_ID) PRIMARY_KEY AUTO_INCREMENT
	LONGRAW_(IMG_DATA)
END_TABLE


And to update image in sql:
	sql * SqlUpdate(IMAGES)(IMG_DATA, SqlBinary( JPGEncoder().SaveString(img) ) ).Where(IMG_ID == resId);


In fact the image is stored as a string (I don't remember why: it's been 3 years since I wrote this code, maybe because I export it in XML afterwards

Hope this helps
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: StaticImage cannot show BMP file
Next Topic: >Port 9(say port 10)
Goto Forum:
  


Current Time: Sun Aug 24 18:57:08 CEST 2025

Total time taken to generate the page: 0.04449 seconds