F
franky
HI
I declare a enum like that:
public enum MyType
{
open = 1,
close= 2
};
I got a error when a try to do :
MyType var1;
int var2;
var1 = (MyType) cmd.ExecuteScalar();
//== but ok like this ===========
var2 = Convert.toInt32( cmd.ExecuteScalar() );
var1 = (MyType) var2;
Do I forgot something?
I declare a enum like that:
public enum MyType
{
open = 1,
close= 2
};
I got a error when a try to do :
MyType var1;
int var2;
var1 = (MyType) cmd.ExecuteScalar();
//== but ok like this ===========
var2 = Convert.toInt32( cmd.ExecuteScalar() );
var1 = (MyType) var2;
Do I forgot something?