I´d like to deserialize a big JSON File (~600MB) into DataGridView without facing "maxJsonLength" Error.
My Code is working fine for small JSON files. But for bigger JSON files I get the "maxJsonLength" Error. Is there a workaround or an easy way to solve this problem since I am not the most experienced coder?
Private Sub BtnOpenFile_Click(sender As Object, e As EventArgs) Handles BtnOpenFileOld.Click
OpenFileDialog1.InitialDirectory = "C:\"
If OpenFileDialog1.ShowDialog = DialogResult.Cancel Then
End If
Dim JSonFilePath As String = File.ReadAllText(OpenFileDialog1.FileName)
LblFilePath.Text = OpenFileDialog1.FileName
DataGridView1.Rows.Clear()
DataGridView1.Refresh()
Dim dict As Object = New JavaScriptSerializer().Deserialize(Of List(Of Object))(JSonFilePath)
For Each item As Object In dict
DataGridView1.Rows.Add(item("EMail").ToString, item("Timestamp").ToString, item("Number").ToString)
Next
End Sub
My JSON File looks like
[
{
"EMail": "one@mail.com",
"Timestamp": "2019-05-25T21:24:06.799381+02:00",
"Number": 206074,
"randomtrash1": "notneeded",
"randomtrash2": "notneeded",
"randomtrash3": "notneeded",
"randomtrash4": "notneeded",
"randomtrash5": "notneeded",
"randomtrash6": "notneeded",
"randomtrash7": "notneeded",
"randomtrash8": "notneeded",
"randomtrash9": "notneeded"
},
{
"EMail": "two@mail.com",
"Timestamp": "2019-05-25T21:24:06.8273826+02:00",
"Number": 7397,
"randomtrash1": "notneeded",
"randomtrash2": "notneeded",
"randomtrash3": "notneeded",
"randomtrash4": "notneeded",
"randomtrash5": "notneeded",
"randomtrash6": "notneeded",
"randomtrash7": "notneeded",
"randomtrash8": "notneeded",
"randomtrash9": "notneeded",
"randomtrash10": "notneeded",
"randomtrash11": "notneeded",
"randomtrash12": "notneeded",
"randomtrash13": "notneeded",
"randomtrash14": "notneeded",
"randomtrash15": "notneeded",
"randomtrash16": "notneeded",
"randomtrash17": "notneeded",
"randomtrash18": "notneeded",
"randomtrash19": "notneeded",
"randomtrash20": "notneeded",
"randomtrash21": "notneeded"
}
]