Hi,
Your inner loop traversal is incorrect.
In innner loop you have used foreach but accessing item with i(variable);
Modify the inner loop code as below.
string sSQL="select JOBNO from RentalVehicle";
dataset ds = munshi.executeDS(sSQL,"Jobs").Tables["Jobs"];
foreach(DataRow Erow in ds.Rows)
{
int CLB_RowNo = 0;
string[] JNos = Erow["JOBNO"].ToString().Split(', ');
string SelectedJob = "", AJob = "";
foreach (Object obj in CLB_JobNo.Items)
{
SelectedJob = obj.ToString();
foreach (string part in JNos)
{
AJob = part.ToString();
if (SelectedJob == AJob)
{
CLB_JobNo.SetItemChecked(CLB_RowNo, true);
}
}
CLB_RowNo++;
}
}