Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Practical use of JSON

Posted on 2010-11-23
7
Medium Priority
?
300 Views
Last Modified: 2012-05-10
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.
0
Comment
Question by:RadhaKrishnaKiJaya
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 34202658
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/
0
 

Author Comment

by:RadhaKrishnaKiJaya
ID: 34202704
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.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 34202769
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
0
Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

 

Author Comment

by:RadhaKrishnaKiJaya
ID: 34287134
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.
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 34287176
1) you unserialize the object with a c# object and you read value of the member
2) you serialize it...
3) JSON is light
0
 

Author Closing Comment

by:RadhaKrishnaKiJaya
ID: 34320843
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.
0
 
LVL 82

Expert Comment

by:leakim971
ID: 34320922
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!

0

Featured Post

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question