Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Value was either too large or too small for an Int32 in asp.net

Tags:

c#

asp.net

I have a singup forum, in which there is aphone number field

code is:

try
{
    cz.SignUp(nametxt.Value, passtxt.Value,  
    Convert.ToInt32(DropDownList1.SelectedValue),  
    Convert.ToInt32(DropDownList2.SelectedValue),
    Convert.ToInt32(DropDownList3.SelectedValue),
    mailtxt.Value,Convert.ToInt32(numbtxt.Value));
    //GridView1.DataSource=ca.viewadmin();
    Lbe6.Text = ("Signup Success");             
}
catch
{
    lbe5.Text = ("FAILED");
}

But when I click on submit the button it shows me an error. Value was either too large or too small for an Int32.

I also tried uint and int64 but it did not work

like image 231
user3044672 Avatar asked Dec 11 '22 09:12

user3044672


1 Answers

Phone numbers are not numbers.

You should use a string.

Remember: If you can't add it, it isn't a number.

like image 68
SLaks Avatar answered Jan 12 '23 00:01

SLaks