title: DataTable or IList? Which is better?
body: <p>I had following Service method - </p>
  
  <pre><code>public static DataTable GetBookDetails(BookEntities context)
      {
          DataTable dtBooks= new DataTable();
          dtBooks.TableName = "BookDetails";
          dtBooks.Columns.Add(new DataColumn("Name",typeof(string)));
          dtBooks.Columns.Add(new DataColumn("ISBN",typeof(string)));
          dtBooks.Columns.Add(new DataColumn("Price",typeof(int)));
          dtBooks.Columns.Add(new DataColumn("Author",typeof(string)));
          IQueryable&lt;Book&gt; query = from b in context.Books.Include("Authors")
                                                                        .Include("Details/Price")
                                                                        .Include("Activity")
                                       where b.Activity.IsActive
                                       select b;
          if (query != null)
          {
              var sorted = query.ToArray().OrderByDescending(b =&gt; b.Activity.DateCreated);
              foreach (Book bb in sorted)
              {
                  DataRow row = dtBooks.NewRow();
                  row["Name"] = bb.Name;
                  row["ISBN"] = bb.ISBN;
                  row["Price"] = bb.Details.Price.CostOfBook;
                  row["Author"] = bb.Authors.Name;
                  dtBooks.Rows.Add(row);
              }
          }
          else
              dtBooks= null;
          return dtBooks;
      }
  </code></pre>
  
  <p>My Questions are -</p>
  
  <ol>
  <li>Is this an efficient way to get details or can I improve this method?</li>
  <li>Someone suggested me to use IList instead of DataTable. Should I use this? If so, what are the advantages?</li>
  <li>What's wrong in using DataTable?</li>
  </ol>