Adhikar Patil

Adhikar Patil

  • NA
  • 481
  • 122.7k

How to use FindByValue in Asp.Net With CheckboxList

Jul 3 2018 2:00 AM
Hello,
 
I have table like 
 
 CourseId CourseName   CourseType
 zxxxzx  Asp.Net 3.0  1
 zxxxzx  Asp.Net 4.0  2
 
So i want to select only course by using CourseId and CourseType. So how to use find by value. Below is my code 
 
for (int i = 0;i< dsData.Tables[0].Rows.Count; i++)
{
if (dsData.Tables[0].Rows[i]["Course_id"].ToString() != "")
{
string courseid;
courseid = dsData.Tables[0].Rows[i]["Course_id"].ToString();
string coursetype;
coursetype = dsData.Tables[0].Rows[i]["CourseType"].ToString();
string IsActive;
IsActive = dsData.Tables[0].Rows[i]["Is_Active"].ToString();
if (IsActive == "True")
{
chkCourseList.Items.FindByValue(courseid).Selected = true;
chkCourseList.Items.FindByValue(coursetype).Selected = true;
}
}
}
 
In Above table CourseId is same but CourseType is different.
 
So how to use FindByValue using multiple condition

Answers (1)