title: ASP.net MVC Data Table Ajax Error
body: <p>Im creating my firts MVC app, this app should thisplays in Data Table all the info Stored in my Tables "Clientes", this table  was created using SQL Server andis being link to my project using Entity  Framework.</p>
  
  <p>but when i run my code I got this error message: </p>
  
  <pre><code>DataTables warning: table id=myDataTable - Ajax error. For more information about this error, please see http://datatables.net/tn/7
  
  
  @{
      Layout = null;
  }
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta name="viewport" content="width=device-width" class="tablecontainer" /&gt;
      &lt;title&gt;Index&lt;/title&gt;
      &lt;!--Hojas de estilo ( Archivos planos de texto para poner estilos a mis etiquetas)--&gt;
      &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" /&gt;
      &lt;link rel="stylesheet" href="https://cdn.datatables.net/1.10.13/css/jquery.dataTables.min.css" /&gt;
      &lt;link href="~/Content/themes/base/jquery-ui.min.css" rel="stylesheet" /&gt;
      &lt;link rel="stylesheet" href="~/Style/miprimerStyle.css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;!--Ancho del padre--&gt;
      &lt;div class="tamaño" id="tamaño"&gt; 
          &lt;!--a es hipervinculos--&gt;
          &lt;a class="popup btn btn-primary Margin20" href="/home/save/0" &gt;Agregar un nuevo cliente &lt;/a&gt;
          &lt;table id="myDataTable"&gt;
              &lt;thead&gt;
                  &lt;!--Fila--&gt;
                  &lt;tr&gt;
                      &lt;!--Columna--&gt;
                      &lt;th&gt;Nombre&lt;/th&gt; 
                      &lt;th&gt;Apellido&lt;/th&gt;
                      &lt;th&gt;Telefono&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
          &lt;/table&gt;
      &lt;/div&gt;
      &lt;script src="~/Scripts/jquery-3.1.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="~/Scripts/jquery.validate.min.js"&gt;&lt;/script&gt;
      &lt;script src="~/Scripts/jquery.validate.unobtrusive.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdn.datatables.net/1.10.13/js/jquery.dataTables.min.js"&gt;&lt;/script&gt;
      &lt;script src="~/Scripts/jquery-ui-1.12.1.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          $(document).ready(function () {
              var oTable = $('#myDataTable').DataTable({
                  "ajax": {
                      "url" : '/home/GetEmployees',
                      "type" : "get",
                      "datatype" : "json"
                  },
                  "columns": [
                      { "data": "Nombre", "autoWidth": true },
                      { "data": "Apellido", "autoWidth": true },
                      { "data": "Telefono", "autoWidth": true },
                  ]
              })
          })
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and this is my Home Controller:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Mvc;
  using System.Web.Script.Serialization;
  
  namespace TestDeConocimientos.Controllers
  {
      public class HomeController : Controller
      {
          public ActionResult Index()
          {
              return View();
          }
          public ActionResult GetEmployees()
          {
              using (TerasysDBEntities1 dc = new TerasysDBEntities1())
              {
                 var clientes = dc.Clientes.OrderBy(a =&gt; a.Nombre).ToList();
                 return Json(new { data = clientes }, JsonRequestBehavior.AllowGet);
              }
          }
      }
  }
  </code></pre>
  
  <p>I also put a breakpoint at  the line:</p>
  
  <pre><code>var clientes = dc.Clientes.OrderBy(a =&gt; a.Nombre).ToList();
  </code></pre>
  
  <p>and I could See that   ll the Data is perfectly stored on the Var "Clients"</p>
  
  <p>What is happening Here?</p>