title: Loading data into html table using ajax and SQL stored procedure
body: <p>I have a stored procedure that selects all the fields in the table based on the date. I then created a method shown below to return the results as JSON.</p>
  
  <pre><code>[HttpGet]
  public JsonResult GetResult()
          {
              MonthNameConverter converter = new MonthNameConverter();
              string fullDate = converter.startOfMonth().ToShortDateString();
              string[] split = fullDate.Split('/');
              string date = "";
              if(Convert.ToInt32(split[0]) &lt; 10)
              {
                  date = split[2] + "-0" + split[0];
              }
              else
              {
                  date = split[2] + "-" + split[0];
              }            
              var results = travelSOCC.GetLansingMileage(date).ToList();
              return Json(results, JsonRequestBehavior.AllowGet);
          }
  </code></pre>
  
  <p>However when I go to append the data to an HTML table I'm getting an unidentified result.</p>
  
  <pre><code>$(function LoadData() {
              $("#LansingTable tbody tr").remove();
              $.ajax({
                  type: 'GET',
                  url: '@Url.Action("GetResult")',
                  dataType: 'json',
                  data: JSON,
                  success: function (data) {
                      $.each(data, function (item) {
                          var rows = "&lt;tr&gt;&lt;td&gt;" + item.TravelDate + "&lt;/td&gt;&lt;td&gt;" + item.TripType + "&lt;/td&gt;&lt;/tr&gt;";
                          $("#LansingTable tbody").append(rows);
                      });
                  },
                  error: function (ex) {
                      var r = jQuery.parseJSON(response.resonseText);
                      alert("Message: " + r.Message);
                  }
              })
          });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/u9blF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u9blF.png" alt=""></a></p>
  
  <p>Any help is greatly appreciated.</p>