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

Please help with an overflow error with database

P: n/a
Dan
Hi. I'm having a problem with searching a databse entry. I'm new to dotnet
and still trying to figure some things out.

In order to locate a row in an access databse file .mdb, i am using this
call

Dim dr As DataRow
dr = Me.DsMaster.Tables("MasterList").Rows.Find(Me.txtS can.Text)

where me.txtscan.text is a value from 2 to 9323493000236.
when searching for smaller values i have nu problem. but when i search for
the larger values i get an error.

An unhandled exception of type 'System.OverflowException' occurred in
mscorlib.dll
Additional information: Value was either too large or too small for an
Int32.

I have tried converting but i still get the same error. I need to be able to
search for these values as they are unit ID numbers. Is there a way to do
this?
Perhaps there is a better way to search the database for the row containing
the data? Any help would be great.

Thanks alot

Dan Butler
ba********@hotmail.com
Nov 20 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
The maximum number of rows that a DataTable can store is 16,777,216. Data
sets contain data tables.
For more info:
http://tinyurl.com/37sxa
"Dan" <ba********@hotmail.com> wrote in message
news:pRsJb.37246$gN.8936@fed1read05...
Hi. I'm having a problem with searching a databse entry. I'm new to dotnet
and still trying to figure some things out.

In order to locate a row in an access databse file .mdb, i am using this
call

Dim dr As DataRow
dr = Me.DsMaster.Tables("MasterList").Rows.Find(Me.txtS can.Text)

where me.txtscan.text is a value from 2 to 9323493000236.
when searching for smaller values i have nu problem. but when i search for
the larger values i get an error.

An unhandled exception of type 'System.OverflowException' occurred in
mscorlib.dll
Additional information: Value was either too large or too small for an
Int32.

I have tried converting but i still get the same error. I need to be able to search for these values as they are unit ID numbers. Is there a way to do
this?
Perhaps there is a better way to search the database for the row containing the data? Any help would be great.

Thanks alot

Dan Butler
ba********@hotmail.com

Nov 20 '05 #2

P: n/a
Well, look at the size of the number

9,323,493,000,236

Int32:=

2,147,483,647

There is your problem.

Regards - OHM

Dan wrote:
Hi. I'm having a problem with searching a databse entry. I'm new to
dotnet and still trying to figure some things out.

In order to locate a row in an access databse file .mdb, i am using
this call

Dim dr As DataRow
dr = Me.DsMaster.Tables("MasterList").Rows.Find(Me.txtS can.Text)

where me.txtscan.text is a value from 2 to 9323493000236.
when searching for smaller values i have nu problem. but when i
search for the larger values i get an error.

An unhandled exception of type 'System.OverflowException' occurred in
mscorlib.dll
Additional information: Value was either too large or too small for an
Int32.

I have tried converting but i still get the same error. I need to be
able to search for these values as they are unit ID numbers. Is there
a way to do this?
Perhaps there is a better way to search the database for the row
containing the data? Any help would be great.

Thanks alot

Dan Butler
ba********@hotmail.com


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #3

P: n/a
Dan
Thanks for the responses!
Maybe if i explain what i am working with, perhaps someone could help me
out.
I have a database with 15,150 rows. The numbers in column one, representing
an ID range from 2 to 9323493000236. All uniquie entries, no duplicates.
Since there are only 15,000 rows (or so) you can tell that alot of number
skipping is going on.
The way it wors is the user enters in a barcode number via hand or scanner.
The program then is supposed to search for the value. However, when i use
the find i spoke of in my earlier post, i was getting the overflow error. I
figured since the data was within the acceptable amount of rows, I would be
able to search for it? I think i am probably going about searching for the
corresponding row (or index) the wrong way.

Thanks again
Dan Butler
Ba********@hotmail.com
"Dan" <ba********@hotmail.com> wrote in message
news:pRsJb.37246$gN.8936@fed1read05...
Hi. I'm having a problem with searching a databse entry. I'm new to dotnet
and still trying to figure some things out.

In order to locate a row in an access databse file .mdb, i am using this
call

Dim dr As DataRow
dr = Me.DsMaster.Tables("MasterList").Rows.Find(Me.txtS can.Text)

where me.txtscan.text is a value from 2 to 9323493000236.
when searching for smaller values i have nu problem. but when i search for
the larger values i get an error.

An unhandled exception of type 'System.OverflowException' occurred in
mscorlib.dll
Additional information: Value was either too large or too small for an
Int32.

I have tried converting but i still get the same error. I need to be able to search for these values as they are unit ID numbers. Is there a way to do
this?
Perhaps there is a better way to search the database for the row containing the data? Any help would be great.

Thanks alot

Dan Butler
ba********@hotmail.com

Nov 20 '05 #4

P: n/a
You might try searching using a String instead of and Int32.

"Dan" <ba********@hotmail.com> wrote in message
news:ORGJb.37320$gN.32105@fed1read05...
Thanks for the responses!
Maybe if i explain what i am working with, perhaps someone could help me
out.
I have a database with 15,150 rows. The numbers in column one, representing an ID range from 2 to 9323493000236. All uniquie entries, no duplicates.
Since there are only 15,000 rows (or so) you can tell that alot of number
skipping is going on.
The way it wors is the user enters in a barcode number via hand or scanner. The program then is supposed to search for the value. However, when i use
the find i spoke of in my earlier post, i was getting the overflow error. I figured since the data was within the acceptable amount of rows, I would be able to search for it? I think i am probably going about searching for the
corresponding row (or index) the wrong way.

Thanks again
Dan Butler
Ba********@hotmail.com
"Dan" <ba********@hotmail.com> wrote in message
news:pRsJb.37246$gN.8936@fed1read05...
Hi. I'm having a problem with searching a databse entry. I'm new to dotnet and still trying to figure some things out.

In order to locate a row in an access databse file .mdb, i am using this
call

Dim dr As DataRow
dr = Me.DsMaster.Tables("MasterList").Rows.Find(Me.txtS can.Text)

where me.txtscan.text is a value from 2 to 9323493000236.
when searching for smaller values i have nu problem. but when i search for the larger values i get an error.

An unhandled exception of type 'System.OverflowException' occurred in
mscorlib.dll
Additional information: Value was either too large or too small for an
Int32.

I have tried converting but i still get the same error. I need to be able
to
search for these values as they are unit ID numbers. Is there a way to

do this?
Perhaps there is a better way to search the database for the row

containing
the data? Any help would be great.

Thanks alot

Dan Butler
ba********@hotmail.com


Nov 20 '05 #5

P: n/a
Cor
Hi Dan,

Why not first fill a little dataset with a "where" clause or use a
datareader with that?

Would give you a lot of more performance I think

Cor
Thanks for the responses!
Maybe if i explain what i am working with, perhaps someone could help me
out.
I have a database with 15,150 rows. The numbers in column one, representing an ID range from 2 to 9323493000236. All uniquie entries, no duplicates.
Since there are only 15,000 rows (or so) you can tell that alot of number
skipping is going on.
The way it wors is the user enters in a barcode number via hand or scanner. The program then is supposed to search for the value. However, when i use
the find i spoke of in my earlier post, i was getting the overflow error. I figured since the data was within the acceptable amount of rows, I would be able to search for it? I think i am probably going about searching for the
corresponding row (or index) the wrong way.

Nov 20 '05 #6

P: n/a
That would be a good idea unless you where searching through the data with a
lot.
Another option would be to use a DataView.

"Cor" <no*@non.com> wrote in message
news:Op**************@TK2MSFTNGP09.phx.gbl...
Hi Dan,

Why not first fill a little dataset with a "where" clause or use a
datareader with that?

Would give you a lot of more performance I think

Cor
Thanks for the responses!
Maybe if i explain what i am working with, perhaps someone could help me
out.
I have a database with 15,150 rows. The numbers in column one, representing
an ID range from 2 to 9323493000236. All uniquie entries, no duplicates.
Since there are only 15,000 rows (or so) you can tell that alot of number skipping is going on.
The way it wors is the user enters in a barcode number via hand or

scanner.
The program then is supposed to search for the value. However, when i use the find i spoke of in my earlier post, i was getting the overflow error. I
figured since the data was within the acceptable amount of rows, I would

be
able to search for it? I think i am probably going about searching for

the corresponding row (or index) the wrong way.


Nov 20 '05 #7

P: n/a
Dan,
What is the type of your primary key column? You are passing a string
to search with boxed as an object which may be causing some of the problems.
Try calling Convert.Toxxx(Me.txtScan.Text) where xxx is the type of the
column.
If the column is of type char instead of varchar you may have to pad the
string appropriately first.

Ron Allen
"Dan" <ba********@hotmail.com> wrote in message
news:ORGJb.37320$gN.32105@fed1read05...
Thanks for the responses!
Maybe if i explain what i am working with, perhaps someone could help me
out.
I have a database with 15,150 rows. The numbers in column one, representing an ID range from 2 to 9323493000236. All uniquie entries, no duplicates.
Since there are only 15,000 rows (or so) you can tell that alot of number
skipping is going on.
The way it wors is the user enters in a barcode number via hand or scanner. The program then is supposed to search for the value. However, when i use
the find i spoke of in my earlier post, i was getting the overflow error. I figured since the data was within the acceptable amount of rows, I would be able to search for it? I think i am probably going about searching for the
corresponding row (or index) the wrong way.

Thanks again
Dan Butler
Ba********@hotmail.com
"Dan" <ba********@hotmail.com> wrote in message
news:pRsJb.37246$gN.8936@fed1read05...
Hi. I'm having a problem with searching a databse entry. I'm new to dotnet and still trying to figure some things out.

In order to locate a row in an access databse file .mdb, i am using this
call

Dim dr As DataRow
dr = Me.DsMaster.Tables("MasterList").Rows.Find(Me.txtS can.Text)

where me.txtscan.text is a value from 2 to 9323493000236.
when searching for smaller values i have nu problem. but when i search for the larger values i get an error.

An unhandled exception of type 'System.OverflowException' occurred in
mscorlib.dll
Additional information: Value was either too large or too small for an
Int32.

I have tried converting but i still get the same error. I need to be able
to
search for these values as they are unit ID numbers. Is there a way to

do this?
Perhaps there is a better way to search the database for the row

containing
the data? Any help would be great.

Thanks alot

Dan Butler
ba********@hotmail.com


Nov 20 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.