DataTables jquery.dataTables.min.js:181 Uncaught TypeError: Cannot read property 'length' of undefined
<p>I can't specify what/where is the problem, here is my code :</p>

<p>HTML :</p>

<pre><code>                    &lt;table id="companies" class="table table-striped table-bordered table-hover"&gt;
                    &lt;thead&gt;
                        &lt;tr&gt;
                            &lt;th class="center"&gt;
                                Id
                            &lt;/th&gt;
                            &lt;th&gt;RegNo&lt;/th&gt;
                            &lt;th&gt;Name&lt;/th&gt;
                            &lt;th class="hidden-480"&gt;Industry&lt;/th&gt;

                            &lt;th class="hidden-phone"&gt;
                                Size
                            &lt;/th&gt;
                            &lt;th class="hidden-480"&gt;LineOfDefence&lt;/th&gt;

                            &lt;th&gt;Address&lt;/th&gt;
                        &lt;/tr&gt;
                    &lt;/thead&gt;
                &lt;/table&gt;
</code></pre>

<p>Server side : </p>

<pre><code>   var result = new
    {
        rows = (from company in db.Company.ToList()
                select new
                {
                    id = company.CompanyId,
                    RegNo = company.RegestrationNumber,
                    Name = company.Name,
                    Industry = company.IndustryType.Name,
                    Size = company.CompanySize.Name,
                    LineOfDefence = company.LineOfDefence.Name,
                    Address = company.Address
                }).ToArray()
    };
    return Json(result, JsonRequestBehavior.AllowGet);
</code></pre>

<p>and here is my Ajax Call :</p>

<pre><code>&lt;script&gt;
    $(document).ready(function ()
    {
        $('#companies').DataTable( {
            "ajax": {
                url: "/Company/GetCompanyGrid",
                type: "GET",
                dataType: "json"
            }
        });
    });
&lt;/script&gt;
</code></pre>

<p>I'm getting this error : "jquery.dataTables.min.js:181 Uncaught TypeError: Cannot read property 'length' of undefined"</p>

<p>note : I'm using jquery-1.12.3.js &amp; DataTables 1.10.12.</p>

<p>Any help would be appreciated .</p>