G
Guest
Hi,
I'm running into an error while trying to get the output value of an
identity column. In my database, the identity column is of type 'bigint',
which is what seems to be causing the problem.
The DAAB syntax I'm using for adding in an output parameter is:
string storedProcName = "myInsertProcName";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetStoredProcCommand(myInsertProcName);
//add Input parameters - works fine
db.AddOutParameter(cmd, "idColumn", DbType.Int64, ???);
As you can see from the line above, the ??? is where I hit my problem. The
API requires an 'int size' with the description being the max possible size
of the return value. I tested this issue with a dummy table, setting the
seed to int.maxvalue, and it does throw an exception, with an arithmetic
error. While I don't have this many records yet, I anticipate it in the
future.
I should probably mention it is an insert method, and I'm running
db.ExecuteNonQuery(cmd) against the database.
I looked around and couldn't find anyone else running into this problem, so
any help would be appreciated.
Thanks,
Pete
I'm running into an error while trying to get the output value of an
identity column. In my database, the identity column is of type 'bigint',
which is what seems to be causing the problem.
The DAAB syntax I'm using for adding in an output parameter is:
string storedProcName = "myInsertProcName";
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetStoredProcCommand(myInsertProcName);
//add Input parameters - works fine
db.AddOutParameter(cmd, "idColumn", DbType.Int64, ???);
As you can see from the line above, the ??? is where I hit my problem. The
API requires an 'int size' with the description being the max possible size
of the return value. I tested this issue with a dummy table, setting the
seed to int.maxvalue, and it does throw an exception, with an arithmetic
error. While I don't have this many records yet, I anticipate it in the
future.
I should probably mention it is an insert method, and I'm running
db.ExecuteNonQuery(cmd) against the database.
I looked around and couldn't find anyone else running into this problem, so
any help would be appreciated.
Thanks,
Pete