Solved

Practical use of JSON

Posted on 2010-11-23
7
292 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
  • 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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 500 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn how to count occurrences of each item in an array.

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now