Hello, I need to trigger an insert statement into my SQL database every time certain buttons are pressed.
There are a total of 6 buttons, which makes having:
string connString MySqlConnection conn = new MySqlConnection(connString); MySqlCommand command = conn.CreateCommand();
etc, etc. 6 times over in each button seem very inefficient having to repeat code numerous times.
I was wondering if someone could recommend a better way to achieve this?