Login
Register
Tutorials
Forum
Career Development
Resources
Reviews
Jobs
Interview
Communities
Projects
Training
Silverlight Games
|
Bookmarks
|
New Members FAQ
|
Mentor
|
Code Converter
|
IT Companies
|
Peer Appraisal
|
Members
|
Revenue Sharing
|
Computer Jokes
|
New Posts
|
Social
|
Online Members
Pawan Awasthi
Alwyn Duraisingh
More...
Forums
»
.NET
»
Webservices
»
How to consume data from json file through webservice?
Posted Date:
09 Jul 2012
Posted By::
Mrudula
Member Level:
Bronze
Member Rank:
2869
Points
: 2
Responses:
1
Hi friends,
i have a req like i need to create a webservice which will be used to read data from a json file and put the data back into a table.
Any idea how to go for this?
and also i wnat to know abt json files?how they are created and how they are usefull.
Thanks in Advance
Mrudula
Tweet
Responses
#680262 Author:
Abhishek Arya
Member Level:
Gold
Member Rank:
19
Date: 13/Jul/2012 Rating:
Points
: 4
example of simple jason data. It will just like text file. Below link will give you someidea
http://json.codeplex.com/
System.Web.Script.Serialization.JavaScriptSerializer js = new System.Web.Script.Serialization.JavaScriptSerializer();
string json = @"{
'key1': 'value1',
'key2': 'value2',
'key3': false,
'key4': 10
}";
Dictionary<string, string> dic = js.Deserialize<Dictionary<string, string>>(json); // deserialize
foreach (KeyValuePair<string,string> o in dic)
{
// do whatever
}
dic.Add("newKey", "new value"); // add an attribute
string newjson = js.Serialize(dic); // serialize back to string
Post Reply
This thread is locked for new responses. Please post your comments and questions as a
separate thread
.
If required, refer to the URL of this page in your
new post
.
Tweet
Next :
Call button click event from webmethod
Previous :
Can byte[] be a input to webservice
Return to Discussion Forum
Post New Message
Category:
Related Messages
How to synchronize data?
Search File on FTP Server..it's urgent
Parsing a XML file using WebService
what is webservice
i need to create a web service
Active Members
Today
Pawan Awasthi
(46)
naveensanagase...
(21)
Kapil
(13)
Last 7 Days
naveensanagase...
(224)
Pawan Awasthi
(190)
Naved Hasan ...
(189)
more...
Awards & Gifts
Email subscription
.NET Jobs
.NET Articles
.NET Forums
Articles Rss Feeds
Forum Rss Feeds
Talk to Webmaster Tony John