2

How can i serialize bulk data by using JSON JavaScriptSerializer in C#? I tried but got error which mentioned below

"Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property"

Anyone tell me how can i serialize bulk data plz???

RAKESH HOLKAR
  • 2,127
  • 5
  • 24
  • 42
  • 1
    http://stackoverflow.com/questions/1151987/can-i-set-an-unlimited-length-for-maxjsonlength-in-web-config – spender May 07 '12 at 11:23
  • You might have a look at [The length of the string exceeds the value set on the maxJsonLength property. in MVC3](http://stackoverflow.com/questions/19108743/the-length-of-the-string-exceeds-the-value-set-on-the-maxjsonlength-property-in/35025467#35025467) – Murat Yıldız Jan 26 '16 at 22:46

3 Answers3

2

Try this

 JavaScriptSerializer jsJson = new JavaScriptSerializer();
 jsJson.MaxJsonLength = 2147483644;
Asif Mushtaq
  • 13,010
  • 3
  • 33
  • 42
  • 1
    I had tried this but it didn't solved my problem. I am facing problem while using DataContractJsonSerializer for bulk data. – RAKESH HOLKAR May 07 '12 at 11:47
1

you can use DataContractJsonSerializer

Vishal Parekh
  • 92
  • 1
  • 8
0

I believe this has been caused by one of your properties being simply too long in length. Can we see some code and background regarding the data involved?

Jon Free
  • 203
  • 3
  • 9