title: Clear() or Dispose() to clear dataset assigned to new Dataset() in C#?
body: <p>What should I use to clear DataSet which I assign to <code>new Dataset()</code> on every new SQL call in my C# code (Windows Mobile Compact Framework)?</p>
  
  <p>At the moment I am using Clear(), however I am not sure if I should be using Dispose instead. What would be proper choice for this?</p>
  
  <p>Some code:</p>
  
  <p>Inside frmA (main form where I perform SQL search of database) I save my search result into Database and if count is greater than 0, I go to another form <code>frmNewWork</code> to do some work with found data:</p>
  
  <pre><code>// search SQL
  // declare connectionString and command... 
  SqlCeDataAdapter adapter = new SqlCeDataAdapter(mCommand);
  modFunctions.tempDataset = new NEWDataSet();
  adapter.Fill(modFunctions.tempDataset, "item");
  foundCount = modFunctions.tempDataset.item.Count;
  
  // Goes off to another form to do somework with that dataset
  if (foundCount &gt; 0)
  {
      frmNewWork myForm = new frmNewWork();
      myForm.ShowDialog()
  }
  </code></pre>
  
  <p>Now... once I return from <code>myForm</code>, I want to clear that database, and I do that inside form A <code>GotFocus</code> function:</p>
  
  <pre><code>private void frmA_GotFocus(object sender, EventArgs e)
  {
      // Clear prior tempDataset (was .Clear() originally)
      modFunctions.tempDataset.Dispose();
  }
  </code></pre>