title: How to remove datatable from dataset?
body: <p><code>.aspx</code> code:</p>
  
  <pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchCustomer.aspx.cs" Inherits="WebApplication1.eyeofheaven.SearchCustomer" %&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en" xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head runat="server"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /&gt;
  &lt;link rel="stylesheet" type="text/css" href="StyleSheets/SearchCustomerStyle.css"&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css"&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap-theme.min.css"&gt;
  &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;title&gt;Search Customer&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="form1" runat="server"&gt;
   &lt;div class="row"&gt;
      &lt;div class="twelve columns"&gt;
              &lt;!-- Header--&gt;
              &lt;div class="container"&gt;
                  &lt;nav role="navigation" class="navbar navbar-inverse navbar-fixed-top"&gt;
                      &lt;!-- Brand and toggle get grouped for better mobile display --&gt;
                      &lt;div class="navbar-header"&gt;
                          &lt;button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle"&gt;
                              &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt;
                              &lt;span class="icon-bar"&gt;&lt;/span&gt;
                              &lt;span class="icon-bar"&gt;&lt;/span&gt;
                              &lt;span class="icon-bar"&gt;&lt;/span&gt;
                          &lt;/button&gt;
                      &lt;/div&gt;
                      &lt;!-- Collection of nav links, forms, and other content for toggling --&gt;
                      &lt;div id="navbarCollapse" class="collapse navbar-collapse"&gt;
                          &lt;ul class="nav navbar-nav"&gt;
                              &lt;li&gt;&lt;a href="EyeOfHeaven.aspx"&gt;Home&lt;/a&gt;&lt;/li&gt;
                              &lt;li class="dropdown"&gt;
                                  &lt;a data-toggle="dropdown" class="dropdown-toggle active" href="#"&gt;Search&lt;b class="caret"&gt;&lt;/b&gt;&lt;/a&gt;
                                  &lt;ul role="menu" class="dropdown-menu"&gt;
                                      &lt;li&gt;&lt;a href="SearchCustomer.aspx"&gt;Search Form(Customer)&lt;/a&gt;&lt;/li&gt;
                                      &lt;li&gt;&lt;a href="SearchVehicle.aspx"&gt;Search Form(Vehicle)&lt;/a&gt;&lt;/li&gt;
                                  &lt;/ul&gt;
                              &lt;/li&gt;
                          &lt;/ul&gt;
                      &lt;/div&gt;
                  &lt;/nav&gt;
              &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;!-- Search form customer--&gt;
  &lt;div id="searchcustomer" class="page-header"&gt;
      &lt;h3&gt;&lt;span class="glyphicon glyphicon-th-large"&gt;&lt;/span&gt;Search Customer&lt;/h3&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;div class="col-md-4"&gt;
          &lt;input type="text" runat="server" id="search" size="20" class="form-control" placeholder="Customer ID"&gt;
      &lt;/div&gt;
      &lt;div class="col-md-4"&gt;
          &lt;select class="form-control" runat="server" id="Country"&gt;
              &lt;option value="select" selected disabled&gt;Search by Country&lt;/option&gt;
              &lt;option value="A:C ESTUDIO"&gt;A:C ESTUDIO&lt;/option&gt;
              &lt;option value="Aaron McEwen-194712"&gt;Aaron McEwen-194712&lt;/option&gt;
              &lt;option value="Accra"&gt;Accra&lt;/option&gt;
              &lt;option value="Adoany"&gt;Adoany&lt;/option&gt;
              &lt;option value="Aduanas"&gt;Aduanas&lt;/option&gt;
              &lt;option value="Alex Sanchez-259029"&gt;Alex Sanchez-259029&lt;/option&gt;
              &lt;option value="ALG Consulting-288078"&gt;ALG Consulting-288078&lt;/option&gt;
              &lt;option value="Algeria"&gt;Algeria&lt;/option&gt;
              &lt;option value="Algimantas Ramaskevicius"&gt;Algimantas Ramaskevicius&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;  
  
      &lt;div class="col-md-4"&gt;
          &lt;select class="form-control" runat="server" id="Currency"&gt;
              &lt;option value="selected" selected disabled&gt;Search by Currency&lt;/option&gt;
              &lt;option value="AUD"&gt;AUD (Australian Dollar)&lt;/option&gt;
              &lt;option value="EUR"&gt;EUR (Euro)&lt;/option&gt;
              &lt;option value="GBP"&gt;GBP (United Kingdom Pounds)&lt;/option&gt;
              &lt;option value="JPY"&gt;JPY (Japan Yen)&lt;/option&gt;
              &lt;option value="NZD"&gt;NZD (New Zealand Dollar)&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="row"&gt;
      &lt;div class="col-md-4"&gt;
  &lt;button type="button" runat="server" onserverclick="Button1_Click" id="searchinfo" class="btn btn-primary"&gt;&lt;span class="glyphicon glyphicon-search"&gt;&lt;/span&gt; Search Info&lt;/button&gt;
  &lt;button type="button" runat="server" onserverclick="Button2_Click" id="Button2" class="btn btn-danger"&gt;&lt;span class="glyphicon glyphicon-repeat"&gt;&lt;/span&gt;Reset&lt;/button&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;!-- Information Table--&gt;
  &lt;div id="gridview"&gt;
      &lt;asp:GridView runat="Server" id="data" CssClass="table table-striped table-bordered table-responsive"&gt;
      &lt;/asp:GridView&gt;
  &lt;/div&gt;
  
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><code>.aspx</code> code behind:</p>
  
  <pre><code>using MSSQLConnector;
  using System;
  using System.Collections.Generic;
  using System.Data;
  using System.Data.SqlClient;
  using System.Linq;
  using System.Text;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  
  namespace WebApplication1.eyeofheaven
  {
      public partial class SearchCustomer : System.Web.UI.Page
      {
          protected void Page_Load(object sender, EventArgs e)
          {
          }
          protected void Button1_Click(object sender, EventArgs e)
          {
  
              MSConnector connector = new MSConnector();
              connector.ConnectionString = "SERVER=xbetasql,52292;UID=username;Password=secret;DATABASE=ATDBSQL;";
  
              string customer = (this.search.Value);
              string country = (this.Country.Value);
              string idcurrency = (this.Currency.Value);
              string query = null;
  
              if (country != "select")
              {
                  if (idcurrency != "selected")
                  {
                      query = "select * from customer where country = '" + country + "' and idcurrency = '" + idcurrency + "'";
                  }
                  else
                  {
                      query = "select * from customer where country = '" + country + "'";
                  }
              }
              DataSet selectedData = connector.ExecuteQuery(query);
              DataTable dt = selectedData.Tables[0];
              if (dt.Rows.Count &gt; 0)
              {
                  data.DataSource = dt;
                  data.DataBind();
              }
              else
              {
                  Response.Write("&lt;script&gt;alert('No Data Found.')&lt;/script&gt;");
              }
          }
          protected void Button2_Click(object sender, EventArgs e, MSConnector connector, string query)
          {
              DataSet selectedData = connector.ExecuteQuery(query);
              DataTable dt = selectedData.Tables.Remove(dt);
              this.search.Value = "";
              this.Country.Value = "select";
              this.Currency.Value = "selected";
  
          }
      }
  }
  </code></pre>
  
  <p>I have a problem in my code, I want to remove the <code>datatable</code> from <code>dataset</code> when I click on <code>Button2_Click</code> as a reset button for all. But I have an error in my code in here:</p>
  
  <pre><code>DataTable dt = selectedData.Tables.Remove(dt);
  </code></pre>
  
  <p>It says:</p>
  
  <blockquote>
    <p>Cannot implicitly convert type 'void' to 'System.Data.DataTable'</p>
  </blockquote>
  
  <p>Does passing my <code>dataset</code> and <code>datatable</code> is the problem on the function <code>Button2_Click()</code>? </p>