Bonjour,
Comment je peux recuperer les valeurs dans une checkboxlist?
Acuellement j'utilise pour chaqu'un des elements le code suivants:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
If CheckBoxList1.Items(0).Selected = True Then
Mycommand2 = New SqlCommand("insert_AVOIR_1", myConnection)
Mycommand2.CommandType = CommandType.StoredProcedure
Mycommand2.Parameters.Add("@Id_Anomalie_1", SqlDbType.Int).Value = ValeurID
Mycommand2.Parameters.Add("@Mode_2", SqlDbType.NVarChar).Value = CheckBoxList1.Items(0).Value
Mycommand2.ExecuteNonQuery()
End If
...
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
Et ainsi pour les autres
J'ai déja testé ce code la mais il y a un mesaage d'erreur qui dit :
Trop d'arguments sont spécifiés pour la procédure ou la fonction insert_AVOIR_1
//////////////////////////////////////////////////////////////////////////////////////////////////
Mycommand2 = New SqlCommand("insert_AVOIR_1", MyConnection)
Mycommand2.CommandType = CommandType.StoredProcedure
For Each Item In CheckBoxList1.Items
If Item.Selected = True Then
Mycommand2.Parameters.Add("@Id_Anomalie_1", SqlDbType.Int).Value = 5
Mycommand2.Parameters.Add("@Mode_2", SqlDbType.NVarChar).Value = CheckBoxList1.SelectedItem.Value
Mycommand2.ExecuteNonQuery()
End If
Next
/////////////////////////////////////////////////////////////////////////////////////////////////////
Est ce que quelqu'un connais comment je peux faire la recuperation??
Merci beaucoup d'avance