title: convert data table to list<>
body: <p>i am trying to convert data table to list in web service to get it in java script . i tried the below code</p>
  
  <pre><code>rows = (from p in dt.AsEnumerable()
              select new TableProperty() { }).ToList&lt;TableProperty&gt;();
  
      for (int i = 0; i &lt; rows.Count; i++)
      {
         // Get List of table Properties..
          List&lt;TableProperty&gt; tProperties = new List&lt;TableProperty&gt;();
  
          for (int j = 0; j &lt; dt.Columns.Count; j++)
          {
              try
              {
                  TableProperty propertyValue = new TableProperty()
                  {
                      name = dt.Columns[j].ToString(),
                      serial = dt.Columns[j].ToString(),
                      address = dt.Columns[j].ToString(),
                      mobile = dt.Columns[j].ToString(),
                      password = dt.Columns[j].ToString()
                  };
                  tProperties.Add(propertyValue);
              }
              catch (Exception ex)
              {
                  ex.ToString();
              }
          }
  
  
      }
  
      return rows;
  </code></pre>
  
  <p>where is dt is my data table ,TableProperty is the class which i set and get my properties</p>
  
  <p>when i get it in java script , my value returns null</p>
  
  <pre><code>function draw_Result(ddata) {
          alert(ddata.length);
          for (var i = 0; i &lt; ddata.length; i++) {
              alert("for");
              try
              {
                  var post = ddata[i].name.toString();
                  alert(post);
              }
              catch (e)
              {
                  alert(e.message);
              }
  
          }
      }
  </code></pre>
  
  <p>any help</p>