Hi i have the following which is meant to insert items into the database when selected and if not it should delete it from the database, however it is not working properly, items are getting inserted again even though they already exist, and they are not getting deleted when the checkbox list item is not selected, here is what my code looks like;
foreach (ListItem item in chkClientList.Items)
{
Questionnaire questionnaire = new Questionnaire();
if (item.Selected == true)
{
questionnaire.QUESTIONNAIRES_ID = m_intQuestionnaireID;
questionnaire.ClientID = Convert.ToInt32(item.Value.ToString());
questionnaireBLC.ListClients.Add(questionnaire);
questionnaireBLC.AddQuestionnaireClients();
}
else if (i ...
Go to the complete details ...