I am trying to display the values from database. The textbox values are displayed successfully but checkbox values are not displayed, and it shows the error. i attached the error on screenshot image below
- sql = "select * from repair where repairid = '" + repairid + "'";
- SqlCommand cmd = new SqlCommand(sql, con);
- SqlDataReader dread;
- con.Open();
- dread = cmd.ExecuteReader();
- while (dread.Read())
- {
- checkBox7.CheckState = dread[6].ToString();
- }