By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,440 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,440 IT Pros & Developers. It's quick & easy.

Arithmetic operation resulted in an overflow.

P: n/a
Hello. I'm having an error in a database access. I'm just making a select
query to a table and using a DataAdapter to Fill a DataSet.

Sometimes it works and sometimes it results in an exception: Arithmetic
operation resulted in an overflow.

The query is the following:
select pausa, (sysdate-fecha)*24*60*60, comentario from
tableA where id = 44

Executing in the DB server (Oracle) it always works. But from the code, many
times it gives the exception above.

The code is quite simple:

Dim con As New OracleConnection(_cadConexion)
Dim da As New OracleDataAdapter(query, con)
Dim res As New DataSet

Try
con.Open()
da.Fill(res)
Catch ex As Exception

The exception is thrown in the da.Fill(res) line.

Any idea?

--

Regards,

Diego F.
May 23 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
is fecha ever NULL ...

what data type is this column defined as in the dataset ... make sure the
number is not over its limit ... ie integer hold 32757 (or something like
that) ... make sure you results fits the field type.


"Diego F." <di********@msn.comwrote in message
news:uP**************@TK2MSFTNGP03.phx.gbl...
Hello. I'm having an error in a database access. I'm just making a select
query to a table and using a DataAdapter to Fill a DataSet.

Sometimes it works and sometimes it results in an exception: Arithmetic
operation resulted in an overflow.

The query is the following:
select pausa, (sysdate-fecha)*24*60*60, comentario from
tableA where id = 44

Executing in the DB server (Oracle) it always works. But from the code,
many times it gives the exception above.

The code is quite simple:

Dim con As New OracleConnection(_cadConexion)
Dim da As New OracleDataAdapter(query, con)
Dim res As New DataSet

Try
con.Open()
da.Fill(res)
Catch ex As Exception

The exception is thrown in the da.Fill(res) line.

Any idea?

--

Regards,

Diego F.

May 23 '07 #2

P: n/a
Yes, the problem is in that field. It is a date field. It returns an empty
result. What can be the problem? sysdate-sysdate returns 0, not an empty
result. Fecha has the actual date.

--

Regards,

Diego F.

"jeff" <jhersey at allnorth dottt comwrote in message
news:Oh****************@TK2MSFTNGP03.phx.gbl...
is fecha ever NULL ...

what data type is this column defined as in the dataset ... make sure the
number is not over its limit ... ie integer hold 32757 (or something like
that) ... make sure you results fits the field type.


"Diego F." <di********@msn.comwrote in message
news:uP**************@TK2MSFTNGP03.phx.gbl...
>Hello. I'm having an error in a database access. I'm just making a select
query to a table and using a DataAdapter to Fill a DataSet.

Sometimes it works and sometimes it results in an exception: Arithmetic
operation resulted in an overflow.

The query is the following:
select pausa, (sysdate-fecha)*24*60*60, comentario from
tableA where id = 44

Executing in the DB server (Oracle) it always works. But from the code,
many times it gives the exception above.

The code is quite simple:

Dim con As New OracleConnection(_cadConexion)
Dim da As New OracleDataAdapter(query, con)
Dim res As New DataSet

Try
con.Open()
da.Fill(res)
Catch ex As Exception

The exception is thrown in the da.Fill(res) line.

Any idea?

--

Regards,

Diego F.


May 23 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.