|
|
@ -137,6 +137,8 @@ namespace SqlSugar |
|
|
|
return result; |
|
|
|
} |
|
|
|
public static T GetConvertValue<T>(this IDataRecord dr, int i) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
if (dr.IsDBNull(i)) |
|
|
|
{ |
|
|
@ -145,6 +147,15 @@ namespace SqlSugar |
|
|
|
var result = dr.GetValue(i); |
|
|
|
return UtilMethods.To<T>(result); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
if (dr.GetFieldType(i) == UtilConstants.DateType) |
|
|
|
{ |
|
|
|
return UtilMethods.To<T>(dr.GetConvertDouble(i)); |
|
|
|
} |
|
|
|
throw new Exception(ex.Message); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public static long? GetConvetInt64(this IDataRecord dr, int i) |
|
|
|
{ |
|
|
|