Esempio n. 1
0
        internal static SqlNullValueException SqlNullValue()
        {
            SqlNullValueException e = new SqlNullValueException();

            ADP.TraceExceptionAsReturnValue(e);
            return(e);
        }
Esempio n. 2
0
 public static int Int32(this IDataReader rdr, string name)
 {
     try
     {
         return(rdr.GetInt32(rdr.GetOrdinal(name)));
     }
     catch (InvalidCastException ex)
     {
         throw ex = new InvalidCastException($"Unable to cast the value contained in column '{name}' to System.Int32. The value appears to be of type '{rdr.GetValue(rdr.GetOrdinal(name)).GetType().FullName}'");
     }
     catch (SqlNullValueException ex)
     {
         throw ex = new SqlNullValueException($"The column '{name}' is unexpectedly null.");
     }
 }