G
George Durzi
I have an enum defined as
public enum WineType
{
Bubbly,
Dessert,
Pink,
Red,
White
};
In the codebehind of a webform, I'm doing this:
switch ((WineType) drBottle["Type"])
{
// do something ...
drBottle["Type"] would come in as "Bubbly" or "Dessert", etc...
This compiles but I get an invalid Cast exception when the webform loads.
How do I cast this properly?
public enum WineType
{
Bubbly,
Dessert,
Pink,
Red,
White
};
In the codebehind of a webform, I'm doing this:
switch ((WineType) drBottle["Type"])
{
// do something ...
drBottle["Type"] would come in as "Bubbly" or "Dessert", etc...
This compiles but I get an invalid Cast exception when the webform loads.
How do I cast this properly?