Identify cause of arithmetic overflow error?

DekaFlash

Well-known member
Joined
Feb 14, 2006
Messages
117
Programming Experience
1-3
I have a vb.net application talking to a sql database, when I try to add data to the database I get a arithmetic overflow error.

What is the easiest way to find the cause of Arithmetic overflow error converting int to data type numeric.

It occurs when i run

Me.VsrDataTableAdapter.Update(Me.EquinexMasterSqlDataSet.VsrData)

Thanks
 
Last edited:
you mean, youre attempting to add a number too big for the scale/precision of the database?
 
In my sql database the field in question is defined as decimal(2, 1) but when I try to add data to the field through my vb.net app.

The following exception happens - Parameter value '4.5' is out of range - I know this isn't what I originally required assistance with.
 
and what are the parameter settings in vb, for this parameter?

if youre not sure, type:
?myCmd.Parameters("name_of_parameter")

Into the immediate window, or use the LOCALS window to explore it
 
From locals I identified RaceFurlongs as 1.5D - Decimal

I didn't see a option to type anything into the immediate window, also I'm not sure where in the locals window the parameters would be.
 
I gotta admit, I dont see anything about that number that should cause a problem, but do you get it with a field declared as DECIMAL(3,1)
 
Yeah I set it to decimal(3,1) but its still returning Parameter value '5.0' is out of range.

Could there be anything to do with the vs.net components that my app uses to talk to my sql database, as I didn't have this problem until I changed the data type to decimal.
 

Latest posts

Back
Top