I have a large issue.
I uploaded image and get byte[].
In database I have NVARCHAR(MAX) field and it can't be changed.
What ever I do and save in database I can't get it as image later.
I triedn .ToString() doesn't work.
I have tried this:
private byte[] GetBytes(string str)
{
byte[] bytes = new byte[str.Length * sizeof(char)];
System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
return bytes;
}
static string GetString(byte[] bytes)
{
char[] chars = new char[bytes.Length / sizeof(char)];
System.Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
return new string(chars);
}
And when I try to put it in RadBinaryImage I get nothing.
This is the error:
The provided binary data may not be valid image or may contains unknown header