I have a multidimensional array converted to JSON data in this format.
"[[null,null,null,null,null,null],[null,null,null,1,1,null],[null,null,null,null,1,1],[null,null,null,null,null,null],[null,null,null,null,null,null]]"
I am trying to conver this multidimensional array of strings/integers to equivalent form using JavascriptSerializer like this
Dim retValue As List(Of String)
Dim deserializer As System.Web.Script.Serialization.JavaScriptSerializer = New System.Web.Script.Serialization.JavaScriptSerializer()
retValue deserializer.Deserialize(Of List(Of String))(o.value)
Its throwing an exception: Type 'System.String' is not supported for deserialization of an array.
I tried the same casting it to Integers
, but the same exception occured.
How can I perform the conversion using .NET 3.5.
I dont want to use JSON.NET dll’s , if System.Web.Script.Serialization.JavaScriptSerializer can do the job.
Any suggestions?
I tried two ways in achieving the solution:-
As per “SeanCocteau’s comments:-
In this format, I was able to get the arrayList and then take each internal arrayList by iterating and casting appropriately
Second solution I tried:-
In this format also , I was able to get the arrayList and then take each internal arrayList by iterating and casting appropriately
Thanks SeanCocteau for giving the tip to Convert it to Object first 🙂