Kobinath Ram

Kobinath Ram

  • NA
  • 130
  • 0

Data in not displayed on checkbox in c#.net sqlserver

Apr 21 2019 10:09 AM
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
  1. sql = "select * from repair where repairid = '" + repairid + "'";  
  2. SqlCommand cmd = new SqlCommand(sql, con);  
  3. SqlDataReader dread;  
  4. con.Open();  
  5. dread = cmd.ExecuteReader();  
  6. while (dread.Read())  
  7. {  
  8. checkBox7.CheckState = dread[6].ToString();  
  9. }  
 

Answers (6)