public static int ToInt32(object obj) { int result = 0; Int32.TryParse(obj.ToString(), out result); return result; }