Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Practical use of JSON

Posted on 2010-11-23
7
Medium Priority
?
303 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 83

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 83

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
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 

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 83

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 83

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Suggested Courses

782 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