Link to home
Start Free TrialLog in
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

asked on

Practical use of JSON

Hi Experts,
Please explain the propose of JSON and its use.  I know nothing about it.  Any practical use would be very beneficial.  I understand that it is very easy, but I can't imagine how.  Please help and thanks a lot in advance.
Avatar of leakim971
leakim971
Flag of Guadeloupe image

As XML, JSON is a data format to send and retrieve data.
If you know the structure of a JSON object is easy to get specific data
JSON is lighter than XML
JSON is good to define objects
a car : { "car" : { "brand": "BMW" } ,"available_colors": ["red","blue","pink" ] }

A simple JSON object : {"state":true}

More info : http://json.org/
Avatar of RadhaKrishnaKiJaya
RadhaKrishnaKiJaya

ASKER

Hi leakim971,
Thank you for your help.  I have saveral questions.  
1. Once the data is received in JSON format in a SQL table, how do we normally use it?  
2. What kind of data is normally converted to JSON (format) for sending and receiving?  
3. How do we convert them (I mean what kind of tool we use)?  
4. Finally how does any program read them (for example a C# program)?

Sorry for too many questions.  I am a beginner, so please help.  Thank you again.
1) You've no direct method to parse and/or use JSON object with Database.
   Generaly you build JSON object from database data to send it back to the client and the invert process to stroe JSON object

2) any type of data. simple or complex object. Think JSON is lighter than XML

3) Check ths bottom of this page : http://json.org/
    You will find library to use it

4) the main process is generaly to rebuild the JSON object from a string. In c#, serialization, DataContract, JSONContract and so on... again check the bottom of the link you will see a lot of library
    with Javascript simple to build object from string : eval( "(" + jsonString +")" ) or JSON.parse on recent browser
leakim971,
Hey, I really appricate all yoour help.  Thank you very much for your time.  Few more questions.

1. How the JSON is read in C#?
2. If we need to send some data in JSON, how we would be able to convert it in C#?
3. Please let me know how is it useful.

Thank you again for your help.
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you leakim971 for your wonderful help.  Before you leave, one last question, the serialize/unserialize  something we need to code in C# or use some tools?  Thank you again for your help.
It depend the framework version you're using : http://www.west-wind.com/weblog/posts/442969.aspx

Thanks for the points! Have a nice week-end!