SqlInt32 GetSqlInt32 (int i) { object value = GetSqlValue (i); if (!(value is SqlInt32)) throw new InvalidCastException ("Type is " + value.GetType ().ToString ()); return (SqlInt32) value; }