title: Deserialize byte array column in DataTable with JSON.net
body: <p>I have a project that accepts a SQL server query, passes this query to a web service that executes this query, passes the results back to the client which then returns the <code>DataSet</code> result (as well as a few additional properties).  Currently it uses WCF and SOAP for the communication.  In order to reduce the total request time I'm trying to move this to Web API and JSON.  According to my proof of concept this has cut down the total request time by about 30%, which is significant given the throughput of this service.</p>
  
  <p>My problem is that some of the queries (which I have no control over) return data from an image column in SQL Server.  The JSON.net data table converter quite happily picks this up as a byte array and base64 encodes it.  The problem occurs at the client side where the same converter simply picks up this value and treats it as a string, causing problems when the the consumer of my project is expecting it to be a byte array.</p>
  
  <p>I thought I might be able to use the <code>TypeNameHandling.All</code> option on the serializer, but the data table converter doesn't expect to get tokens of type <code>JsonToken.StartObject</code> as part of the body of a <code>DataTable</code>.</p>
  
  <p>Given that I have no control over the queries that are run, what data types are expected to be returned and no control over how they're consumed, is there anything I can do to successfully pass a byte array as part of a data table with JSON.net?</p>