Click here to Skip to main content
15,894,720 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to Deserialization of the given string
My code goes here
using System.Runtime.Serialization.Json;
using System.Runtime.Serialization;

   public class TestL
    {
        public string RESULT { get; set; }
        public string TYPES { get; set; }
        public string HEADER { get; set; }
        public string ROW { get; set; }

    }
 class Program
    {
        static void Main(string[] args)
        {
              var  jsonString = "[{\"RESULT\":{\"TYPES\":[\"bigint\",\"varchar\",\"int\",\"int\",\"varchar\",\"varchar\",\"varchar\",\"varchar\",\"varchar\",\"varchar\",\"bigint\",\"varchar\",\"decimal\",\"decimal\",\"date\"],\"HEADER\":[\"kvk\",\"bedrijfsnaam\",\"kvks\",\"sub\",\"adres\",\"postcode\",\"plaats\",\"type\",\"status\",\"website\",\"vestiging\",\"rechtsvorm\",\"lat_rad\",\"lon_rad\",\"anbi\",\"ROWS\":[[\"273121520000\",\"Kinkrsoftware\",\"27312152\",\"0\",\"Oude Trambaan 7\",\"2265CA\",\"Leidschendam\",\"Hoofdvestiging\",null,\"kinkrsoftware.nl\",\"9789723\",null,null,null,null]]}}";
          
         
            Object ooo= new Object();
            ooo = JsonDeserialize<TestL>(jsonString);
            Console.WriteLine(((JSONDemo.TestL)(ooo)).TYPES);
            Console.ReadLine();     
        }
        public static T JsonDeserialize<T>(string jsonString)
        {
            DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(T));
            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(jsonString));
            T obj = (T)ser.ReadObject(ms);
            return obj;
        }

     
    }


I cannot desearilize my data
this data is
a column return from select query "select * from KVK limit 100"
please help me to desearilize

A lot thanks in advance
Posted
Updated 15-Dec-11 23:21pm
v2
Comments
Sergey Alexandrovich Kryukov 16-Dec-11 11:18am    
What is "console application ASP"?
--SA

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900