I'm need to insert an image into a filemaker container with an insert statement, and while the odbc documentation seems vague without clear examples, I'm trying to get it to work on a simple level as follows:
command line as appears in text visualizer for sqlstr:
INSERT INTO Answer ("UserID","RECNO","RECTYPE","RECSEQ",PutAs(NCICImage, 'JPEG'))
VALUES('hcd','0','0','1',?)
Here's my function to write record:
static void C2Search_WriteRecord(string sqlstr, Image img = null)
{
OdbcCommand cmd = new OdbcCommand(sqlstr);
if (img != null)
{
cmd.Parameters.AddWithValue("?", OdbcType.Image).Value = img;
}
cmd.Connection = connData;
try
{
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
logWriteLine(DateTime.Now.ToString() + ": " + ex.Message);
}
}
When I execute my program using the above sql statement, I get the following message which I'm confused about:
No mapping exists from object type System.Drawing.Bitmap to a known managed provider native type.
How do I make this work as desired?