Coverting JSON file with huge content to dotnet CLR objects like dataset

Mar 7, 2013 at 5:59 AM
Hi ,

I was searching for a way to deserialize a JSON file with huge content , to a dataset . My intension is to deserialize the data from the file and save it on to sqlserver database . Pls help me with the sample . i was struc up at a point to convert the objects to Dataset type.

My code goes as follows,
Dim sreader As New StreamReader("D:\units.json")
    Dim reader As New JsonTextReader(sreader)
    Dim jsSerialize As New JsonSerializer

        Dim ds As New DataSet
    ds = jsSerialize.Deserialize(reader)

I was getting an error saying : Unable to cast object of type 'Newtonsoft.Json.Linq.JObject' to type 'System.Data.DataSet'.

Please help me on this

Thanks & Regards,