Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 1184881

Browse files
committed
fix order of setting DbType and Value when creating DbDataParameter
previous order of setting value before type causes "Value does not fall within the expected range" in oracle, on types like .NET boolean which has no direct corresponding type in the database
1 parent a67aa72 commit 1184881

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ServiceStack.OrmLite/OrmLiteReadCommandExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ internal static IDbCommand SetParameters(this IDbCommand dbCmd, IDictionary<stri
294294
p.ParameterName = kvp.Key;
295295

296296
p.Direction = ParameterDirection.Input;
297-
p.Value = value ?? DBNull.Value;
298297
if (value != null)
299298
dialectProvider.InitDbParam(p, value.GetType());
299+
p.Value = value ?? DBNull.Value;
300300

301301
dbCmd.Parameters.Add(p);
302302
}

0 commit comments

Comments
 (0)