Skip to content

@FilipDeVos /gist:1932766
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
SqlCeParameter.Size implementation
public override int Size
{
get
{
return this.size;
}
set
{
if (this.size == value)
return;
this.BindingChange();
if (value < 0)
{
throw new ArgumentOutOfRangeException(System.Data.SqlServerCe.Res.GetString("ADP_InvalidSizeValue", new object[1]
{
(object) value.ToString((IFormatProvider) CultureInfo.CurrentCulture)
}));
}
else
{
int val2 = int.MaxValue;
switch (this.typeMap.sqlDbType)
{
case SqlDbType.BigInt:
val2 = SqlCeType._BigInt.fixlen;
break;
case SqlDbType.Binary:
val2 = SqlCeType.MAX_BINARY_COLUMN_SIZE;
break;
case SqlDbType.Bit:
val2 = SqlCeType._Bit.fixlen;
break;
case SqlDbType.DateTime:
val2 = SqlCeType._DateTime.fixlen;
break;
case SqlDbType.Decimal:
val2 = SqlCeType._Numeric.fixlen;
break;
case SqlDbType.Float:
val2 = SqlCeType._Float.fixlen;
break;
case SqlDbType.Image:
val2 = SqlCeType.MAX_IMAGE_COLUMN_SIZE;
break;
case SqlDbType.Int:
val2 = SqlCeType._Int.fixlen;
break;
case SqlDbType.Money:
val2 = SqlCeType._Money.fixlen;
break;
case SqlDbType.NChar:
val2 = SqlCeType.MAX_NCHAR_COLUMN_SIZE;
break;
case SqlDbType.NText:
val2 = SqlCeType.MAX_NTEXT_COLUMN_SIZE;
break;
case SqlDbType.NVarChar:
val2 = SqlCeType.MAX_NCHAR_COLUMN_SIZE;
break;
case SqlDbType.Real:
val2 = SqlCeType._Real.fixlen;
break;
case SqlDbType.UniqueIdentifier:
val2 = SqlCeType._UniqueIdentifier.fixlen;
break;
case SqlDbType.SmallInt:
val2 = SqlCeType._SmallInt.fixlen;
break;
case SqlDbType.Timestamp:
val2 = SqlCeType._RowVersion.fixlen;
break;
case SqlDbType.TinyInt:
val2 = SqlCeType._TinyInt.fixlen;
break;
case SqlDbType.VarBinary:
val2 = SqlCeType.MAX_BINARY_COLUMN_SIZE;
break;
}
this.size = Math.Min(value, val2);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.