TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ravi Birla
NA
292
19.9k
Convert string List data to json format
Aug 11 2017 3:00 AM
Hello Everyone
I need your help. I'm working on windows service on 4.0 version using c# i want to convert string list to json format and pass that json data to third party.
My code is:-
List
msisdnlist = new List
();
msisdnlist.Add(rdr.GetInt64(0).ToString());
var jsonSerialiser = new JavaScriptSerializer();
var result = jsonSerialiser.Serialize(msisdnlist);
and also try this one:-
//var result = Newtonsoft.Json.JsonConvert.SerializeObject(msisdnlist);
//var result = JsonConvert.SerializeObject(msisdnlist);
now my problem is i'm not gatting the data in correct format and how to pass that data to third party.
data format which i'm gatting is-
["919464522803","919445453803"]
but i want this format -
{"msisdn": ["9418451354", "9617853673"]}
Please Help me.
Reply
Answers (
6
)
Partial classes under same namespace
VB6 code convert into C#