Mehmet Fatih

Mehmet Fatih

  • 858
  • 939
  • 41.2k

Pulling checkboxes from the database

Jan 29 2024 1:13 PM

I have checkboxes in the access database. When pulling data, it returns true and false. If what I want is true, the checkbox should be output, if it is false, it should be empty.

checkBox1.Text = dataGridView1.CurrentRow.Cells["sehitcocuk"].Value.ToString();

 if (checkBox1.CheckState == CheckState.Checked)
 {
     checkBox1.CheckState = CheckState.Checked;
 }
 else
 {
     checkBox1.CheckState = CheckState.Unchecked;
 }


Answers (1)