title: Error ajax error-datatables warning: table id -example
body: <p>I click "ok" and in console error : </p>
  
  <p><img src="https://i.stack.imgur.com/JXOuP.jpg" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/mr8lj.jpg" alt="enter image description here"></p>
  
  <p>I'm new to programming and I need help. I need to use <code>json</code> to form a datatable from several data structures. At this point, I'm stuck on this error. Help please understand</p>
  
  <p>The function in the controller is json.</p>
  
  <pre><code>[HttpGet]
              public JsonResult Lowx()
              {
                  var query = db.Infos.
                      Include(x =&gt; x.Profile).
                      Include(x =&gt; x.Cars).
                      ToList();
  
                  return Json(new { data = query });
              }
  </code></pre>
  
  <p>table and ajax </p>
  
  <pre><code> &lt;table class= "table" id="example" &gt;
              &lt;thead&gt;
                  &lt;tr &gt;
                      &lt;th&gt;first name&lt;/th&gt;
                      &lt;th&gt;last name&lt;/th&gt;
                      &lt;th&gt;middle name&lt;/th&gt;
                      &lt;th&gt;birthday&lt;/th&gt;
                      &lt;th&gt;carname&lt;/th&gt;
                      &lt;th&gt;carnumber&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;&lt;/tbody&gt;
  
          &lt;/table&gt;
  
          &lt;script src="~/Scripts/jquery-1.10.2.min.js"&gt;&lt;/script&gt;
          &lt;script src="~/Scripts/bootstrap.min.js"&gt;&lt;/script&gt;
          &lt;script src="~/Scripts/jquery.unobtrusive-ajax.min.js"&gt;&lt;/script&gt;
          &lt;script src="~/Scripts/DataTables/jquery.dataTables.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
  
              $(document).ready(function (data) {
               $("#example").DataTable({
        ajax: {
            url: '@Url.Action("Lowx")',
            type: 'GET',
  
            dataSrc: ""
  
        },
        columns: [
          { data: "FirstName", name: "FirstName" },
          { data: "LastName", name: "LastName" },
          { data: "MiddleName", name: "MiddleName" },
          { data: "BirthDate", name: "BirthDate" },
          { data: "CarName", name: "CarName" },
          { data: "CarNumber", name: "CarNumber" }
        ]
      });
  </code></pre>
  
  <blockquote>
    <p>Console: Failed to load resource: the server responded with a status of 500 (Internal Server Error).</p>
  </blockquote>
  
  <p>SCREENSHOTS FOR ALFRED AND ALL)
  <img src="https://i.stack.imgur.com/2cnfL.jpg" alt="enter image description here">
  <img src="https://i.stack.imgur.com/X0Mhv.jpg" alt="enter image description here"></p>
  
  <p>Screenshot copy-paste 
  <img src="https://i.stack.imgur.com/ZEYbL.jpg" alt="enter image description here"></p>