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
scropio gurl
NA
147
99k
JSON array data format
Jul 14 2016 8:09 AM
I have web method in this we method i try to return JSON array and then i use this GetVo in jquery
[WebMethod]
public static string GetVo(DateTime fdate, DateTime tdate, string region)
{
string data2 = "[";
try
{
T1 DB = new T1();
//here is LINQ query which is long so i did not paste
e.g. var rea=from ......... .tolist();
data2 += rea.ToList().Select(x => "['" + x.Name + "'," + x.cnt + "]")
.Aggregate((a, b) => a + "," + b);
data2 += "]";
}
catch (Exception)
{
throw new Exception();
}
return data2;
}
this return me data like this
[['DDSB',39],['DPSB',9],['DSB',26],['MV',35],['PSB',52]]
but i want like this
[["DDSB",39],["DPSB",9],["DSB",26],["MV",35],["PSB",52]]
how i do this
any solution?
Reply
Answers (
2
)
Entity framework -Linq
Return dataset in linq