I'm trying to convert image to byte array but it crashes the application.
The error is something like this:
There was an error deserializing the object. The maximum array length quota (16384) has been exceeded while reading XML data. This quota may be increased by changing the MaxArrayLength property on the XmlDictionaryReaderQuotas object used when creating the XML reader
This is my code:
if (dr["Photo"] != DBNull.Value)
{
rider.Photo = (byte[])dr["Photo"];
}
Is there a better way to do this? Something that works?
Edit: So, I believe it's something to do with image size being too large for it to pass through the web service. I edited the webconfig files and changed the ReaderQuotes tag values like this:
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647"
maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
Even then, the output is same.