Hello,
I need some common function that converts Object value to int. If value is in wrong format and can't convert then return 0.
For this I use next function:
public static int ObjToInt(object obj)
{
int retVal = 0;
if (obj == null)
{
return retVal;
}
int.TryParse(obj.ToString() , out retVal);
return retVal;
} ...
Go to the complete details ...