title: Datagrid displays schema information instead of actual data
body: <p>I have written some code in for connecting to a WCF service and displaying the data from an <code>IEnumerable&lt;Dataset&gt;</code> using a stored procedure call to SQL Server.</p>
  <p>I tested it using the WCF client and it returns this: <a href="https://i.stack.imgur.com/9luhw.png" rel="nofollow noreferrer">WCF Test client result</a> I'm not sure if that is even correct, but it's the only thing that seems to work.</p>
  <p>In the WPF, it seems to connect to and populate the fields, but with the schema information, not the tables from the dataset. I have attached a screenshot for reference.<a href="https://i.stack.imgur.com/u2PQz.png" rel="nofollow noreferrer">Client interface</a></p>
  <p>I have seen this thread on telling the DataGrid which table you want to set:
  <a href="https://stackoverflow.com/questions/28761572/datagridview-not-displaying-data-while-dataset-contains-the-data">DataGridView not displaying data while DataSet contains the data
  </a></p>
  <p>However, that does not seem to apply to my situation as <code>IEnumerator&lt;&gt;</code> does not contain a method 'Tables'. But I feel like the point remains the same i.e. I need to tell the DataGrid what I actually want to show. After googling for hours I am finally here.</p>
  <p>I have also tried declaring an <code>IQueryable</code> and using the <code>.Contains</code> method, but that didn't work either.</p>
  <p>Here is the code in <code>MainWindow.xaml.cs</code>:</p>
  <pre><code>public partial class MainWindow : Window
  {
      // private CollectionViewSource CollectionView;
      public MainWindow()
      {
          InitializeComponent();
          FillDataGrid();
      }
                           
      private void FillDataGrid()
      {
          MBMService.IMBMExtClientService Client = new MBMService.MBMExtClientServiceClient();
          IEnumerable&lt;DataSet&gt; ds;
          ds = Client.GetData();
          MainGrid.ItemsSource = ds;
      }
  }
  </code></pre>
  <p>This is the WCF interface:</p>
  <pre><code>[ServiceContract]
  public interface IMBMExtClientService
  {
      [OperationContract]
      IEnumerable&lt;DataSet&gt; GetData();
  }
  </code></pre>
  <p>This is the WCF implementation:</p>
  <pre><code>public class MBMExtClientService : IMBMExtClientService
  {
      public IEnumerable&lt;DataSet&gt; GetData()
      {
          //call to NYSESQLConnect class and run constructor
          NYSESQLConnect Connect = new NYSESQLConnect();
          return Connect.GetDataSet();
      }
  }
  </code></pre>
  <p>EDIT: Also tried this to no avail</p>
  <pre><code> MBMService.IMBMExtClientService Client = new MBMService.MBMExtClientServiceClient();
          DataSet[] ds = Client.GetData();
          //MainGrid.ItemsSource = ds[0];
          MainGrid.DataContext = ds.ElementAt(0).Tables[&quot;NYSEStockData&quot;];
  </code></pre>