private void BtnExecuteSelectQuery_Click(object sender, EventArgs e)
 {
     myConnection = new MySqlConnection(connectionString);
     using (myDataAdapter = new MySqlDataAdapter(selectQuery, myConnection))
     {
         myCommandBuidler = new MySqlCommandBuilder(myDataAdapter);
         myTable          = new DataTable();
         myDataAdapter.Fill(myTable);
         DgvProducten.DataSource = myTable;
     }
     DgvProducten.ClearSelection();
     BtnRecordVerwijderen.Enabled = false;
     BtnRecordWijzigen.Enabled    = false;
 }
Example #2
0
 private void BtnExecuteSelectQuery_Click(object sender, EventArgs e)
 {
     using (myConnection = new MySqlConnection(connectionString))
     {
         myConnection.Open();
         myDataAdapter    = new MySqlDataAdapter(selectQuery, myConnection);
         myCommandBuidler = new MySqlCommandBuilder(myDataAdapter);
         using (myTable = new DataTable())
         {
             myDataAdapter.Fill(myTable);
             DgvProducten.DataSource = myTable;
             DgvProducten.ClearSelection();
         }
     }
 }