title: Show MySQL database values in DataGridView C#
body: <p>I made a connection to my database, but when I try to view some data from 1 table, is not showing in <code>dataGridView</code>. When I am pressing the button, few seconds seems like is going to show the values, and after that nothing posted in <code>dataGridView</code></p>
  
  <p>Can anyone explain if I made sth wrong in my code?
  I am working in Visual Studio 2013</p>
  
  <p>My code:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      string connectionString = "datasource=localhost;database=microweb;port=3306;username=root;password=pass";
  
      MySqlConnection conn = new MySqlConnection(connectionString);
      MySqlCommand cmd = new MySqlCommand("select * from reservations", conn);
  
      try
      {
          MySqlDataAdapter sda = new MySqlDataAdapter();
          sda.SelectCommand = cmd;
          DataTable dta = new DataTable();
          sda.Fill(dta);
          BindingSource bdsour = new BindingSource();
  
          bdsour.DataSource = dta;
          dataGridView1.DataSource = bdsour;
          sda.Update(dta);
  
      }
      catch (Exception ex)
      {
          MessageBox.Show(ex.Message);
      }    
  }
  </code></pre>