Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i am trying to send phone number into table its showing error like this

The conversion of the varchar value '1234567890' overflowed an int column.
The statement has been terminated.
plz give me solution.....
Posted

You have taken int type column in database.
and you providing no as '1234567890' which is bigger than size of int.
i will prefer to change that column int type to decimal(12,0) or if you want to add signs then
make that as nvarchar(12)
 
Share this answer
 
Comments
Nirav Prabtani 25-Mar-14 3:23am    
agree... +5
TrushnaK 25-Mar-14 5:37am    
Thanks Nirav
You shouldn't overflow an int in .NET or SQL Server with that "phone number" - an int can hold any number between -2,147,483,648 and 2,147,483,647.
Access however has a smaller range, so it depends on your DB.

However, a phone number should not be stored in a numeric field: you can't do arithmetic with it (What is "Your phone number" plus "My phone number"? - rubbish, that's what!)
And if you use a numeric field you lose leading zeros, international symbols and optional brackets / extension numbers.

Use a string based store for phone numbers - that why the data is preserved exactly as the user gave it to you!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900