DataRow dr = null;
OracleCommand cmd = new OracleCommand("Select * From AppMsg Where Message Like 'PDT_%' Order By Message", conn);
OracleDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
dr = dt.NewRow();
dr["Message"] = rdr["Message"];
dr["Value"] = rdr["Value"];
dt.Rows.Add(dr);
}
string json = JsonConvert.SerializeObject(dt);
/**
B4XSerializator ser = new B4XSerializator();
byte[] zipData = ser.ConvertObjectToBytes(json);
string zipString = Convert.ToBase64String(zipData, 0, zipData.Length);
**/
byte[] bytData = System.Text.Encoding.UTF8.GetBytes(json);
MemoryStream ms = new MemoryStream();
Stream s = new DeflaterOutputStream(ms);
s.Write(bytData, 0, bytData.Length);
s.Close();
byte[] compressedData = (byte[])ms.ToArray();
string zipString = Convert.ToBase64String(compressedData, 0, compressedData.Length);
HttpContext.Current.Response.Write(zipString);