What is the .net type compare to Oracle Number(2)

Topics: Development Team Discussion, User Discussion
Nov 24, 2011 at 7:38 AM

Hi,

I am using such code to update values:

cmd = db.GetSqlStringCommand("UPDATE MARS2_USERS SET LOGIN_FAIL_CNT = :LOGIN_FAIL_CNT WHERE USER_ID=:USER_ID");
db.AddInParameter(cmd, "USER_ID", DbType.String, strUserID);
db.AddInParameter(cmd, "LOGIN_FAIL_CNT", DbType.Int16, intCurrentCount);

The field in Oracle DB is Number(2), intCurrentCount is Int16 too. But it always report 'Invalid Number' error.

And then I found if you want to use Number type in Oracle, you should be very carefully to set the length.  Anyone can tell me how to declare the variable when use Number with different length?

Nov 24, 2011 at 8:08 AM

So wired, I change the type to DbType.String, it works now. 

But in database it is Number(2).