I have the following code:
Public Enum Country
Canada = 1
USA = 2
End Enum
When I want to see if the user has selected a value, I do:
ddl.SelectedValue = Country.Canada
Which works fine. However, if I turn on a warning for implicit conversion, this gives a warning. Changing it to
ddl.SelectedValue = Country.Canada.ToString()
fails, since the ToString() method returns "Canada" not "1".
What's the best way to get rid of the warning?