TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Gabriel olayinka
NA
119
4.6k
Working with ListCheckBox
Mar 5 2018 1:38 AM
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
Reply
Answers (
4
)
TimeZone with Different Countries c# code
Select Pdf to create a pdf