i have a database table that consist of ID(int) , NAME(varchar) , ADDRESSING, STATUS(int) ..... I want to Populate a listCheckBox with the table data and check every row where the STATUS ==1..... I'm really getting stuck. I need help on how to do this
here is my code.... i'm working with c# winform
void fillChecklist()
{
try
{
con.Open();
string ct = "select * FROM Detail";
cmd = new SqlCommand(ct);
cmd.Connection = con;
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
//fill the checkListBox with all the table record
{
checkedListBox1.Items.Add(rdr.GetString(1));
if (rdr.GetString(1)==1)
{
//check every row in the checkListbox where STATUS =1
//this is where I’m having major issue
}//end if
}//end while
}//end try
finally
{
con.Close();
}
}//end fillChecklist method

Cynthia SathuragiriRank #937 · 2.2K reputationPosted Mar 4, 2018, 8:52 PM EST
Gabriel olayinka143 reputationPosted Mar 4, 2018, 10:33 PM EST
Cynthia SathuragiriRank #937 · 2.2K reputationPosted Mar 4, 2018, 11:41 PM EST
Gabriel olayinka143 reputationPosted Mar 5, 2018, 1:02 AM EST