title: jquery how to deserialize json object
body: <p>How can you deserialize this json object below?</p>
  
  <pre><code>[{"id":"67","name":"TestString"}]
  </code></pre>
  
  <p>I tried to do this below but couldnt succeed...</p>
  
  <pre><code>success: function (data, status) {
            $.each(data, function (dt) {
  
                var mydata = data.d;
  
                alert(mydata); // returns [{"id":"67","name":"TestString"}]
  
                $("#txt_speciality").tokenInput("add", mydata.id);
            });
  }
  </code></pre>
  
  <p>here is the way I am creating the json object</p>
  
  <pre><code>[WebMethod]
  public static string get_specialities(string ProfessionalID)
  {
      Database db = DatabaseFactory.CreateDatabase("Connection String2");
      DbCommand dbCommand;
      dbCommand = db.GetStoredProcCommand("Select_Professionals_Speciality");
      db.AddInParameter(dbCommand, "prof_id", DbType.Int16, Convert.ToInt16(ProfessionalID));
      IDataReader dr = db.ExecuteReader(dbCommand);
      //[{ id: 3, name: "test3" }]
      string return_str="[";
      int i = 0;
      while (dr.Read()) {
          if (i &gt; 0)
              return_str += ",";
          return_str += "{\"id\":\"" + dr["SpecialtyID"].ToString().Trim() + "\",\"name\":\"" + dr["SpecialtyName"].ToString().Trim() + "\"}";
          i++;
      }
      return_str += "]";
      return return_str;
  }
  </code></pre>