title: How to parse column of table that contain json array to table in asp.net core c#
body: <p>I have a problem.
  I have a column in my table that contains a JSON array, and I need to get this value and display it as a table in a cshtml view</p>
  <p>I created a method that returns JSON of this value.</p>
  <pre><code>public ActionResult GetComposant(String fam)
      {
          var ComposantInfo = ((_context.Fds.Where(e =&gt; e.Fam == fam)).ToList()).Select(e =&gt; e.Chap2).FirstOrDefault();
          Debug.Write(ComposantInfo);
  
  
  
          return Json(ComposantInfo);
      }
  </code></pre>
  <p>In myjquery script I have:</p>
  <pre><code>  $.getJSON(&quot;GetComposant&quot;, { fam: selectedVal.toString() }, function (result) {
              console.log(result);
              console.log(result.length);
  
  
              if (result.length == 0) {
                  $('#msg').text(&quot;CeTTE FAMILLE n'a pas de FDS , veuillez la creer &quot;);
                  $('#msg').css('color', 'red')
                  var tr;
                  //Append each row to html table
  
                  tr = $('&lt;tr style=&quot;background-color: indianred;&quot;/&gt;');
  
                  tr.append(&quot;&lt;td contenteditable='true'&gt;&quot; + &quot;&lt;/td&gt;&quot;);
                  tr.append(&quot;&lt;td contenteditable='true'&gt;&quot; + &quot;&lt;/td&gt;&quot;);
                  tr.append(&quot;&lt;td contenteditable='true'&gt;&quot; + &quot;&lt;/td&gt;&quot;);
                  tr.append(&quot;&lt;td contenteditable='true'&gt;&quot; + &quot;&lt;/td&gt;&quot;);
                  tr.append(&quot;&lt;td contenteditable='true'&gt;&quot; + &quot;&lt;/td&gt;&quot;);
                  $('table').append(tr);
  
              }
              else {
                  $('#msg').text(&quot;FDS existe déja&quot;);
                  $('#msg').css('color', 'green')
                  var tr;
                  //Append each row to html table
                  for (var i = 0; i &lt; result.length; i++) {
                      tr = $('&lt;tr/&gt;');
                      tr.append(&quot;&lt;td&gt;&quot; + result[i].designe + &quot;&lt;/td&gt;&quot;);
                      tr.append(&quot;&lt;td&gt;&quot; + result[i].ncas + &quot;&lt;/td&gt;&quot;);
                      tr.append(&quot;&lt;td&gt;&quot; + result[i].symbole + &quot;&lt;/td&gt;&quot;);
                      tr.append(&quot;&lt;td&gt;&quot; + result[i].poids + &quot;&lt;/td&gt;&quot;);
                      tr.append(&quot;&lt;td&gt;&quot; + result[i].rphrases + &quot;&lt;/td&gt;&quot;);
                      $('table').append(tr);
                  }
              }
  
  
  
          })
  </code></pre>
  <p>I tried to display the result in my console :
  it displays:
  <a href="https://i.stack.imgur.com/qYsOj.png" rel="nofollow noreferrer">enter image description here</a></p>
  <p>that contains three elements, but when I tried to display the length it display 603</p>
  <p>and showed me 603 line of undefined columns.</p>
  <p>Where is the problem?</p>