Everything is correct. But, the problem is in this variable
1stitem
. You cannot use a integer in the first word of declaration. So just replace that and try. That's all your problem.
foreach(ListItem stitem in CheckBoxList1.Items)
{
if(stitem.Selected==true)
{
s += "," + stitem.Text;
}
}