This error is thrown by ASP.NET in a dropdownlist where the selected value (fetched from the database), does not match any of the value in the drop down list and is therefor invalid. To explain this
Note that SelectedValue=5 does not exist in the dropdownlist therefor the error. The above code is for demenstration purpose only. It is not a working code.
Another practical example is below.
<asp:DropDownList ID="DropDownList3" runat="server"
In the above case the SQLDataSource sdsGetErrorCodes fetches a list of error_id’s and Error_codes. If the selected one is not a match to anyone single of the one in the list, .NET would through this error.
Usually it is caused by NULL values which are not accepted in DropDownList or invalid values such as -1 etc.