473,396 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Arithmetic operation resulted in an overflow.

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
2 18856
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: William Ryan | last post by:
As an experienced Java Programmer, trust me on this, stick with .NET if you are already using it. It's hard to tell based on what you post. Is all of your code wrapped in an exception handler? ...
5
by: Codemonkey | last post by:
Hi, When I first installed Visual Studio 2003, I noticed I was getting the follow error when showing a form: A first chance exception of type 'System.ArithmeticException' occurred in...
10
by: Massimiliano Alberti | last post by:
Are there rules on how should the C behave with the arithmetic operations? Are the overflows always ignored? And are they simply truncated? (if I have a 16-bits unsigned short ints unsigned short...
16
by: TTroy | last post by:
Hello, I'm relatively new to C and have gone through more than 4 books on it. None mentioned anything about integral promotion, arithmetic conversion, value preserving and unsigned preserving. ...
4
by: glenn | last post by:
I have a COM Server I've written in C#. I have a client app I've written in Delphi that is calling the C# COM Server. However, one of the functions in the COM Server creates a form and during the...
4
by: Tom | last post by:
I have a VB.NET framework 1.1 application that I am installing on my user's workstation. It works fine on EVERY machine except for one - on this one machine it generates a 'Overflow or underflow in...
9
by: Mike Aubury | last post by:
Is there any standard (or even non-standard) way to detect limit overflow in arithmetic in C ? eg. /* assuming 4 byte ints.. */ int a=2147483647; int b=2147483647; int c;
1
by: thebigsquid | last post by:
hi, its me again, so this software obviously has serious problems. now i'm getting this error message when i try to access any of it! any ideas much appreciated thanks the big squid An...
10
by: Why Tea | last post by:
I understood that the CPU registers determine the size of the machine. But what is the correct way to code an arithmetic operation to avoid wrap-around when the code is to be run on both 32-bit and...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.