I have a field of type Yes/No (checkbox) in my sharepoint list. I am trying to change/set the value of the field programmatically (server code), but it give me an error saying that it should be 1 or 0. I cannot get it working. Can anyone help me please?
here that part of the code:
SPListItem item = reportList.Items.Add();
item["RequesterID"] = id;
**item["ZIP_x0020_Code_x0020_Linked"] = 0;**
item["ZC_x0020_code"] = txtZcCode.Text;
item.Update();
For a Yes/No field, you should set it to "1" or "0":
item["ZIP_x0020_Code_x0020_Linked"] = "0";
Look here for more info: