[odb-users] Storing Images in SQL Server 2008

Tarik BENZ tenchu.tarik at hotmail.fr
Mon Jul 1 10:17:50 EDT 2013


Hello,

I am trying to use ODB to store images in a sql server 2008 database.

I am trying to do it in that way :
#include <vector>
..

const std::vector<unsigned char> getPicture() const
{
    return this->picture;
}

void setPicture(const std::vector<unsigned char> picture)
{
    this->picture = picture;
 }

#pragma db type("IMAGE")
#pragma db get(getPicture) set(setPicture)
std::vector<unsigned char> picture;

BUT I have a compilation error :

1>  Participant.hxx:234:13: error: accessor returning a value cannot be used for a data member of SQL Server long data type
1>  Participant.hxx:234:13: info: accessor returning a const reference is required
1>  Participant.hxx:235:29: info: data member is defined here

Can anyone help me to solve this problem?

Thank you!
Tarik

 		 	   		  


More information about the odb-users mailing list