I am retrieving data from the database and serializing it into a JSON string. The following has worked for me:
List<MyClass> myList= ...;
string strJSON = new JavaScriptSerializer().Serialize(myList);
But it only works for small chunks of data. When I attempt to use it to retrieve large amount of data, I get the following error "The length of the string exceeds the value set on the maxJsonLength property”.
Changing the value of maxJsonLength does not work since the amount of data is too large.
I need another way of serializing my data into JSON string and writing it to a .json file. Can anyone help?