title: Populate a DataSet using Context - Entity Framework 4
body: <p>I have some Data returning from a Context. Data has being pulled by <code>spCmsCategoriesReadHierarchy</code>.</p>
  
  <p>I <strong>need</strong> take all Data from Context and populate my DataSet. My final goal is to populate a TreeView Control with DataSet object.</p>
  
  <p>Any ideas? Thanks for your time and patience.</p>
  
  <pre><code>using (TestHierarchyEntities context = new TestHierarchyEntities())
  {
      int n = 0;
      Int16 sl = 1;
      ObjectParameter nn = new ObjectParameter("nn", typeof(int));
  
      // Create a Data Set where adding the result of context 
      DataSet dataSet = new DataSet("myDataSet");
  
      foreach (CmsCategory categories in context.spCmsCategoriesReadHierarchy(n,sl,nn))
      {
      }
  }
  </code></pre>