public string toJSON(SqlDataReader o) { StringBuilder s = new StringBuilder(); s.Append(\"[\"); if (o.HasRows) while (o.Read()) s.App
add reference : System.Web.Extensions to project then
System.Web.Extensions
using System.Web.Script.Serialization;
in c# code, you can use write :
var json = new JavaScriptSerializer().Serialize(obj);