The implicit conversion of the nvarchar data type into varbinary (max) is not allowed. Use the CONVERT function to perform this query

2

Follow the code below:

byte[] image1 = ConvertTo.Bytes(Request.Files[0]);
byte[] image2 = null;

ctx
.Users
.Where(x => x.Id == 1)
.Update(x => new User()
{
    ImageByte1 = image1,
    ImageByte2 = image2
});

I use this here: link

Only the problem if I set null to ImageByte2 . Here is an error:

  

The implicit conversion of the nvarchar data type into varbinary (max) does not   is allowed. Use the CONVERT function to execute this query

Now your self set ImageByte1 and ImageByte2 as null , does update normally or ImageByte1 and ImageByte2 other than null also does update.

Any solution?

    
asked by anonymous 11.11.2017 / 00:18

1 answer

0

The problem has already been fixed with the most up-to-date version.

Nuget: link

    
29.11.2017 / 14:07