title: Do I have to set DataTable to null after using it?
body: <p>I am new to C# and I am using windows forms.</p>
  
  <p>I have about 50 <code>user controls</code> in my C# project and each <code>user control</code> reads data from local SQL server. The SQL query is located in the <code>user control's</code> constructor as shown in the following code:</p>
  
  <pre><code> public partial class BurgersUC : UserControl
  {
      SqlConnection MyConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString);
      SqlCommand MyCommand = new SqlCommand();
      DataTable DataTable = new DataTable();
      SqlDataAdapter Sql_Data_Adapter = new SqlDataAdapter();
  
  
  
   public BurgersUC()
       {
  
          InitializeComponent();
  
          try
          {
  
  
              DataTable.Rows.Clear();
              DataTable.Columns.Clear();
  
              MyConnection.Open();
              MyCommand.CommandText = "SELECT * FROM BurgerTable";
              MyCommand.Connection = MyConnection;
              Sql_Data_Adapter.SelectCommand = MyCommand;
              Sql_Data_Adapter.Fill(DataTable);
  
               button1.Text = Convert.ToString(DataTable.Rows[0]["Burger_Type"]);
  
               .
  
               .
  
               .
  
  
               button30.Text = Convert.ToString(DataTable.Rows[29]["Burger_Type"]);
  
  
             // DataTable = null;  
  
              MyCommand.Parameters.Clear();
              Sql_Data_Adapter.Dispose();
              MyConnection.Close();
  
  
  
          }
  
          catch (System.Exception excep)
          {
  
              MessageBox.Show(excep.Message);
  
          }
  
  
    }
  
  
  }
  </code></pre>
  
  <p>My question is: </p>
  
  <p>in terms of saving some memory do I have to set the DataTable to <code>NULL</code> after using it? Thank you</p>