title: "DataTable already belongs to another DataSet"
body: <p>I can't figure out why I am getting a "DataTable already belongs to another DataSet" exception.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>DataSet AlertSet = new DataSet();
  
  DataTable generalAlertData = new DataTable("GeneralAlertData");
  generalAlertData = //function that returns datatable
  
  //throws exception
  AlertSet.Tables.Add(generalAlertData)
  </code></pre>
  
  <p>When is another dataset being created and when is the generalAlertData datatable being added to it?</p>
  
  <p>I tried using a slightly different syntax to create and add the table and got the same error:</p>
  
  <pre><code>DataSet AlertSet = new DataSet();
  
  DataTable generalAlertData = //function that returns datatable
  
  //throws exception
  AlertSet .Tables.Add(generalAlertData);
  </code></pre>