I am populating a check list box from the database as follows:

for (int i = 0; i < intClassID; i++)
{
strClassID = dtClass.Rows[i]["ClassID"].ToString();
strName = dtClass.Rows[i]["Name"].ToString();

chklstClass.Items.Add(new ListItem(strName, strClassID));
}

So each item in the listbox has an ID

Now I would like to retrieve so that the IDs are selected approprioately. This is what I do:

for (int i = 0; i <= dtClass.Rows.Count - 1; i++)
{
int intClassID = int.Parse(dtClass.Rows[i][0].ToString());
chklstClass.Items[intClassID].Selected = true;
}

It does not seem to get the proper ID's
What am I doing wrong?
is this to do with SetItemChecked(i, true) ?

Thanks