title: convert from SqlDataReader to JSON
body: <pre><code>public string toJSON(SqlDataReader o)
  {
      StringBuilder s = new StringBuilder();
      s.Append("[");
      if (o.HasRows)
          while (o.Read())
              s.Append("{" + '"' + "Id" + '"' + ":" + o["Id"] + ", "
              + '"' + "CN" + '"' + ":" + o["CatName"] + ", "
              + '"' + "Ord" + '"' + ":" + o["Ord"] + ","
              + '"' + "Icon" + '"' + ":" + o["Icon"] + "}, ");
      s.Remove(s.Length - 2, 2);
      s.Append("]");
      o.Close();
      return s.ToString();
  }
  </code></pre>
  
  <p>I'm using here my own function to do serialization . I need to know if this is a good way or I should use another . BTW I've tried to use the <code>JavaScriptSerializer</code> but this didn't work with SqlDataReader . thanx </p>