public static int ConvToInt(String v, int dv) { int ret; if (Int32.TryParse(v, out ret)) { return ret; } else { return dv; } }