Possible Duplicate:
Type Checking: typeof, GetType, or is?
What is the difference between the following:
bool isLong (object a){
return (a.GetType()==typeof(INT64));
}
bool isLong (object a){
return (typeof(a)==typeof(INT64));
}
bool isLong (object a){
return (a is INT64);
}
In addition. there is an option that a will be null. Does those functions can handle such case?
( I need to convert "value" to long? for example: c.CustomerId = (long?)value; )
can I use: long? id=(a as long?)