@@ -12,7 +12,7 @@ public static bool TryGetBoolean(this DbDataReader rs, int ordinal, out bool val
12
12
value = rs.GetBoolean(ordinal);
13
13
return true;
14
14
}
15
- catch (InvalidCastException )
15
+ catch (Exception )
16
16
{
17
17
value = default;
18
18
return false;
@@ -26,7 +26,7 @@ public static bool TryGetByte(this DbDataReader rs, int ordinal, out byte value)
26
26
value = rs.GetByte(ordinal);
27
27
return true;
28
28
}
29
- catch (InvalidCastException )
29
+ catch (Exception )
30
30
{
31
31
value = default;
32
32
return false;
@@ -40,7 +40,7 @@ public static bool TryGetChar(this DbDataReader rs, int ordinal, out char value)
40
40
value = rs.GetChar(ordinal);
41
41
return true;
42
42
}
43
- catch (InvalidCastException )
43
+ catch (Exception )
44
44
{
45
45
value = default;
46
46
return false;
@@ -54,7 +54,7 @@ public static bool TryGetDecimal(this DbDataReader rs, int ordinal, out decimal
54
54
value = rs.GetDecimal(ordinal);
55
55
return true;
56
56
}
57
- catch (InvalidCastException )
57
+ catch (Exception )
58
58
{
59
59
value = default;
60
60
return false;
@@ -68,7 +68,7 @@ public static bool TryGetDouble(this DbDataReader rs, int ordinal, out double va
68
68
value = rs.GetDouble(ordinal);
69
69
return true;
70
70
}
71
- catch (InvalidCastException )
71
+ catch (Exception )
72
72
{
73
73
value = default;
74
74
return false;
@@ -82,7 +82,7 @@ public static bool TryGetDateTime(this DbDataReader rs, int ordinal, out DateTim
82
82
value = rs.GetDateTime(ordinal);
83
83
return true;
84
84
}
85
- catch (InvalidCastException )
85
+ catch (Exception )
86
86
{
87
87
value = default;
88
88
return false;
@@ -95,7 +95,7 @@ public static bool TryGetFloat(this DbDataReader rs, int ordinal, out float valu
95
95
value = rs.GetFloat(ordinal);
96
96
return true;
97
97
}
98
- catch (InvalidCastException )
98
+ catch (Exception )
99
99
{
100
100
value = default;
101
101
return false;
@@ -108,7 +108,7 @@ public static bool TryGetGuid(this DbDataReader rs, int ordinal, out Guid value)
108
108
value = rs.GetGuid(ordinal);
109
109
return true;
110
110
}
111
- catch (InvalidCastException )
111
+ catch (Exception )
112
112
{
113
113
value = default;
114
114
return false;
@@ -136,7 +136,7 @@ public static bool TryGetInt16(this DbDataReader rs, int ordinal, out short valu
136
136
value = rs.GetInt16(ordinal);
137
137
return true;
138
138
}
139
- catch (InvalidCastException )
139
+ catch (Exception )
140
140
{
141
141
value = default;
142
142
return false;
@@ -149,7 +149,7 @@ public static bool TryGetInt32(this DbDataReader rs, int ordinal, out int value)
149
149
value = rs.GetInt32(ordinal);
150
150
return true;
151
151
}
152
- catch (InvalidCastException )
152
+ catch (Exception )
153
153
{
154
154
value = default;
155
155
return false;
@@ -177,7 +177,7 @@ public static bool TryGetInt64(this DbDataReader rs, int ordinal, out long value
177
177
value = rs.GetInt64(ordinal);
178
178
return true;
179
179
}
180
- catch (InvalidCastException )
180
+ catch (Exception )
181
181
{
182
182
value = default;
183
183
return false;
@@ -219,7 +219,7 @@ public static bool TryGetString(this DbDataReader rs, int ordinal, out string va
219
219
value = rs.GetString(ordinal);
220
220
return true;
221
221
}
222
- catch (InvalidCastException )
222
+ catch (Exception )
223
223
{
224
224
value = default;
225
225
return false;
0 commit comments