protected void Add_Click(object sender, ImageClickEventArgs e) { AdminPaytypes.SelectionMode = System.Web.UI.WebControls.ListSelectionMode.Multiple; CustomerPaytypes.SelectionMode = System.Web.UI.WebControls.ListSelectionMode.Multiple; if (AdminPaytypes.SelectedIndex >= 0) { for (int i = 0; i < AdminPaytypes.Items.Count; i++) { if (AdminPaytypes.Items[i].Selected) { if (!array.Contains(AdminPaytypes.Items[i])) { array.Add(AdminPaytypes.Items[i]); } } } for (int i = 0; i < array.Count; i++) { if (!CustomerPaytypes.Items.Contains(((ListItem)array[i]))) { CustomerPaytypes.Items.Add(((ListItem)array[i])); // AT this place i have to set the selected value to the array item i am getting } AdminPaytypes.Items.Remove(((ListItem)array[i])); } }// This J loop also running twice but i have to insert only one item for (int j = 0; j < CustomerPaytypes.Items.Count; j++) { mlocal_strStoredProcName = "uspInsertCustomerPaytypes"; oSysAdminGrantPaytypes.FedTaxID = ddlEmployer.SelectedValue; oSysAdminGrantPaytypes.PayFrequencyTypeID = CustomerPaytypes.SelectedItem.ToString(); oSysAdminGrantPaytypes.PayFrequencyDesc = CustomerPaytypes.SelectedValue; oSysAdminGrantPaytypes.Insert(mlocal_strStoredProcName); //CustomerPaytypes.Items.Clear(); }}