- Home /
How to ignore Overflow Exception
hi,
Am trying to read affected Records from database.
Code:
string[] readArray = new string[reader.RecordsAffected];
when i'm trying to stored in an array its showing error as,
OverflowException: Number overflow. mySqlAccess.SingleSelectWhere (System.String tableName, System.String itemToSelect, System.String wCol, System.String wPar, System.String wValue) (at Assets/mySqlAccess.cs:142) mySqlTest.getDB () (at Assets/mySqlTest.cs:12) mySqlTest.OnGUI () (at Assets/mySqlTest.cs:19)
is there any other way to find this ??
Answer by Bruno Sousa · Nov 13, 2010 at 02:54 PM
Hi
You can't/shouldn't really ignore an OverflowException.
Try debugging and see what reader.RecordAffected value is, my guess is something wrong happening when trying to get the data from the DB and that number will be garbage (either 0, or a very high number)
hi bruno sousa....
i know that Records.Affected value is -1 when we're not modify anything on that database.
You just quoted something I wanted to say in the future ( now :P ) , skills +1
Answer by sriram90 · Nov 16, 2010 at 09:44 AM
Hi,
from above question we cant get affected record values from "select statement". we have to get this value after "add,alter,delete" statements...
when you're not modify your database the records affected value in -1...so,it will surely show "overflow exception". we cant avoid this...
Am sure you can avoid the error by using an IF condition.
Your answer
Follow this Question
Related Questions
Number overflow exception 1 Answer
I'm getting StackOverFlowException 1 Answer
int array overflow exception 1 Answer
StackOverflowException on UI Button message 0 Answers
Quit Menu errors 2 Answers