title: Do I need to explicitly pass a combobox as a reference in a function, or will the compiler do this for me?
body: <p>In C#.NET (WinForms), I have a function that fills up an existing combobox on a form with the result of a query:</p>
  
  <pre><code>FillComboBox("SELECT Value FROM Table", comboBox1);
  
  public void FillComboBox(string query, ComboBox combobox)
      {
          cmd = new MySqlCommand(query, connection);
          reader = cmd.ExecuteReader();
          while (reader.Read())
          {
              combobox.Items.Add(reader[0]);
          }
          combobox.SelectedIndex = 0;
      }
  </code></pre>
  
  <p>The above appears to work fine, however I also have the option of using a reference, as shown below:</p>
  
  <pre><code>FillComboBox("SELECT Value FROM Table", ref comboBox1);
  
  public void FillComboBox(string query, ref ComboBox combobox)
      {
          cmd = new MySqlCommand(query, connection);
          reader = cmd.ExecuteReader();
          while (reader.Read())
          {
              combobox.Items.Add(reader[0]);
          }
          combobox.SelectedIndex = 0;
      }
  </code></pre>
  
  <p>Again, both functions work identically - however is it more efficient or safer in any way to use the latter one, passing the combobox as a reference? Or is the compiler doing this implicitly anyway in the first function?</p>