Commit 356c8621 authored by Young Pay's avatar Young Pay

ThrowDataException is not Complete

parent 885a8d46
......@@ -2639,7 +2639,9 @@ public static void ThrowDataException(Exception ex, int index, IDataReader reade
if (reader != null && index >= 0 && index < reader.FieldCount)
{
name = reader.GetName(index);
object val = reader.GetValue(index);
try
{
object val = reader.GetValue(index); // if there throw an exception, then I got one message, but Which column?
if (val == null || val is DBNull)
{
value = "<null>";
......@@ -2649,6 +2651,11 @@ public static void ThrowDataException(Exception ex, int index, IDataReader reade
value = Convert.ToString(val) + " - " + Type.GetTypeCode(val.GetType());
}
}
catch (Exception valEx)
{
value = valEx.Message;
}
}
toThrow = new DataException(string.Format("Error parsing column {0} ({1}={2})", index, name, value), ex);
}
catch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment