title: How to compress json response in C#
body: <p>Currently, I'm converting datatable to json, it's working fine.</p>
  
  <p>The problem is I want to compress the response. Anyone suggest me. WSID...
  I want something like that :- <a href="https://gist.github.com/chrisnicola/1147568" rel="nofollow">https://gist.github.com/chrisnicola/1147568</a></p>
  
  <pre><code>            using (PooledConnection pooledConnection = AdomdConnectionPool.GetConnection(connstring))
              {
                  // Execute the query
                  AdomdDataAdapter adapter = new AdomdDataAdapter(q, pooledConnection.Connection);
                  DataTable x = new DataTable();
                  adapter.Fill(x);
  
                  System.Web.Script.Serialization.JavaScriptSerializer serializer = new
  
                  System.Web.Script.Serialization.JavaScriptSerializer();
  
                  List&lt;object&gt; header = new List&lt;object&gt;();
                  List&lt;List&lt;object&gt;&gt; rows = new List&lt;List&lt;object&gt;&gt;();
  
                  foreach (DataColumn col in x.Columns)
                  {
                      header.Add(col.ColumnName.Trim());
                  }
  
                  foreach (DataRow row in x.Rows)
                  {
                      List&lt;object&gt; rowtemp = new List&lt;object&gt;();
                      foreach (DataColumn col in x.Columns)
                      {
                          rowtemp.Add(row[col]); //For Row 24012014----- Rohit
                      }
                      rows.Add(rowtemp);
                  }
                  return Response.AsJson(new { header, rows });
  
              }
  </code></pre>