• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by sriram90 · Nov 13, 2010 at 06:13 AM · exceptionoverflow

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 ??

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

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)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sriram90 · Nov 15, 2010 at 04:49 AM 0
Share

hi bruno sousa....

i know that Records.Affected value is -1 when we're not modify anything on that database.

avatar image Proclyon · Nov 16, 2010 at 01:50 PM 0
Share

You just quoted something I wanted to say in the future ( now :P ) , skills +1

avatar image
0
Best Answer

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...

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image diabloroxx · Dec 03, 2010 at 12:06 AM 0
Share

Am sure you can avoid the error by using an IF condition.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

int array overflow exception 1 Answer

StackOverflowException on UI Button message 0 Answers

Number overflow exception 1 Answer

I'm getting StackOverFlowException 1 Answer

Using List.Count on Unity iPhone 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges