ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Save image to SQL

I am trying to save a greyscale U8 image to an SQL database. I have tried using both the "image" and varbinary(MAX) datatypes in SQL Express. In LabView I have used "IMAQ write to string", "write binary file" and, last but not least,  tried converting an image into a 1D array of U8 and then into a hexadecimal string. Each time I get an error message

 

ADO Error 0x80040E07  Exception occured in Microsoft OLE DB for SQL server. Operand type clash.

 

The VI I am using to insert data into the database table is "DB tools insert data". This seems to work well for numeric data so there doesn't appear to be a problem communicating with the database. But when I try to save an image then the error message shown above appears.

 

Does anyone have a possible solution to this?

 

Thanks in advance.

 

LightWorker

 

 

 

 

0 Kudos
Message 1 of 6
(7,260 Views)

I have resolved this problem I believe. You don't need to convert the image to a string - you can use the imagetoarray VI and wire the array directly into the "DB tools insert data" VI. I have used varbinary(MAX) as the data type in SQL as the "image" data type is not recommended. 

 

LightWorker

 

 

 

0 Kudos
Message 2 of 6
(7,239 Views)

Hello

 

Do you have a version for Labview without Vision.

 

I need to view image in crystal reports but I have not managed to get rid of the labview hex characters that are added. I can load it back in labview but not in crystal reports.

 

thanks

JCollado
0 Kudos
Message 3 of 6
(6,057 Views)

Sorry but no, I don't have a non Vision version. 

 

Simon

0 Kudos
Message 4 of 6
(6,053 Views)

Ok

 

Thank you

JCollado
0 Kudos
Message 5 of 6
(6,051 Views)

which is the reverse process of reading that imaq image from database and visualize it? Thanks in advance!

0 Kudos
Message 6 of 6
(4,937 Views)