title: C# Adding rows in DataGridView
body: <p>I currently have the following codes and I would like to add a new row into the DataGridView when buttonX1 is clicked, how can i do this?</p>
  
  <pre><code>    private void Form1_Load(object sender, EventArgs e)
      {
  
          string query = "SELECT * FROM Bill";
  
          OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, DBconn);
  
          OleDbCommandBuilder cBuilder = new OleDbCommandBuilder(dAdapter);
  
          DataTable dTable = new DataTable();
  
          dAdapter.Fill(dTable);
  
          //BindingSource to sync DataTable and DataGridView
          BindingSource bSource = new BindingSource();
  
          //set the BindingSource DataSource
          bSource.DataSource = dTable;
  
          //set the DataGridView DataSource
          dataGridViewX1.DataSource = bSource;
  
          dAdapter.Update(dTable);
  
  
      }
  
      private void buttonX1_Click(object sender, EventArgs e)
      {
          OleDbCommand cmd = new OleDbCommand();
          cmd.CommandType = CommandType.Text;
          cmd.CommandText = "INSERT INTO Bill (Item, Quantity, Price) VALUES ('Soft Drink', 1, 1)";
          cmd.Connection = DBconn;
          DBconn.Open();
          cmd.ExecuteNonQuery();
          DBconn.Close();
      }
  </code></pre>