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

Commit 285f7f0

Browse files
committed
update param size if larger than default
1 parent 23cbc3d commit 285f7f0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ServiceStack.OrmLite/OrmLiteReadCommandExtensions.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,12 @@ public static IDbDataParameter CreateParam(this IDbCommand dbCmd,
927927
p.Direction = direction;
928928

929929
if (p.DbType == DbType.String)
930+
{
930931
p.Size = dialectProvider.GetStringConverter().StringLength;
932+
string strValue = value as string;
933+
if (strValue != null && strValue.Length > p.Size)
934+
p.Size = strValue.Length;
935+
}
931936

932937
if (value != null)
933938
{

0 commit comments

Comments
 (0)