bonjour,
je fait une application avec Aspnet en utilisant la technlogie 3tiers

Dans ma page j'ai une liste qui affiche la liste des employes avec un button supprimer

lorsque je clique sur supprimer un msg d'erreur s'affiche

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: num

Source Error:


Line 219:
Line 220: If Num <= DefaultValues.GetEmplCinValue() Then
Line 221: Throw New ArgumentOutOfRangeException("num")
Line 222: End If
Line 223:



Voila mon code

Public Overrides Function DeleteEmploye(ByVal num As String) As Boolean

If num <= 0 Then
Throw New ArgumentOutOfRangeException("num")
End If

Dim sqlCmd As SqlCommand = New SqlCommand()
AddParamToSQLCmd(sqlCmd, "@ReturnValue", SqlDbType.Int, 0, ParameterDirection.ReturnValue, Nothing)
AddParamToSQLCmd(sqlCmd, "@num", SqlDbType.Char, 0, ParameterDirection.Input, num)
SetCommandType(sqlCmd, CommandType.StoredProcedure, sp_deleteEmp)
ExecuteScalarCmd(sqlCmd)

Dim returnValue As Integer = CInt(sqlCmd.Parameters("@ReturnValue").Value)
If returnValue = 0 Then
Return True
Else
Return False
End If

End Function




Merci d'avance