J
Jonathan Wood
Er... When it's a Decimal.
I'm executing a query that includes the following: "INSERT INTO [...];
SELECT SCOPE_IDENTITY()"
I then attempt to retrieve the scope identity with code that looks like
this:
int contractId = (int)cmd.ExecuteScalar();
I get an "Invalid cast" error. Examing the value returned by
ExecuteScalar(), I see it is 19 and of type Decimal.
Can anyone explain to me why a Decimal with a value of 19 cannot be cast to
an integer?
Thanks.
Jonathan
I'm executing a query that includes the following: "INSERT INTO [...];
SELECT SCOPE_IDENTITY()"
I then attempt to retrieve the scope identity with code that looks like
this:
int contractId = (int)cmd.ExecuteScalar();
I get an "Invalid cast" error. Examing the value returned by
ExecuteScalar(), I see it is 19 and of type Decimal.
Can anyone explain to me why a Decimal with a value of 19 cannot be cast to
an integer?
Thanks.
Jonathan