1

Actually,I'm saving a Image in DB having the datatype image by converting it into byte[].
Now,I'm need to retrieve the data.
So,My Linq Query is :

byte[] str = (byte[])DtImages.Rows[i + 2]["COLUMN_IMAGE"];    
var dataimageid = (from xx in VDC.SURVEY_USER_IMAGES
                   where xx.IMAGE == str && xx.USERID == userid
                   select xx).FirstOrDefault();

Error Message :The data types image and varbinary(max) are incompatible in the equal to operator.

Is that Possible?

4

1 回答 1

0

在映射类中更新您的图像列如下

[Column(UpdateCheck=UpdateCheck.Never)]
public System.Data.Linq.Binary IMAGE 

永远不要对 ntext、text 和 image 进行更新检查,因为 SQL Server 不支持对这些类型进行比较。

于 2013-08-21T08:37:31.570 回答