I wrote a simple program that populates a Datagrid from MySQL
.
In one of my columns I have a Boolean (0 or 1)
Once the Datagrid populates with the query I have check boxes for the boolean.
Does anyone know how to use a function when you check the check boxes for the boolean? (This is to send an update of just the boolean of the column.)
To sum up, When the check-box is checked it changes the boolean value from 0 to 1 in the MySQL
database.
The reason I am having an issue with this is simply because the Datagrid does not populate until I run the application. Therefore, I cannot figure out how to change it while in visual studio.
How the DGV is populated:
MySqlConnection conn = new MySqlConnection(dbConnection);
conn.Open();
MySqlCommand cmd = new MySqlCommand();
cmd.Connection = conn;
MySqlDataAdapter da = new MySqlDataAdapter();
//SQL Query String
string sqlSelectAll = "SELECT * FROM `Tasks` WHERE `Completed` = 0";
da.SelectCommand = new MySqlCommand(sqlSelectAll, conn);
DataTable table = new DataTable();
da.Fill(table);
BindingSource bSource = new BindingSource();
bSource.DataSource = table;
dataGridView1.DataSource = bSource;
Any Help would be grateful.
Note:
I've tried using the data configuration manager in VS2015, which resulted in a completely different error that has nothing to do with this. So that's out of the question.