i want to send a list of tables to client side through httpwebresponse.so what should/can i send to the client.
datatable containing list.
hashtable containing list.
or an object.
or anything else.
according to the list i send to the client i will receive data from the client.
i will convert any of above three to byte array and send it into the stream.
but what should i use.
list is of tables only list no key/value pairs.
client is not a web browser
I would say that it depends on what the client expects, but JSON usually works well to concisely represent structured data.
If the client is a web browser, it isn’t going to know what to do with a byte array (unless it is sent as a binary type, which doesn’t seem appropriate here). Send the data as a string.
The
JavaScriptSerializerorDataContractJsonSerializerare meant for serializing data to JSON.