TextBox type text to Integer

-2

I would like to insert this form into a DB on sql server.

But at the moment as all are txt it does not let me enter through the fields that are whole

as I convert it to whole, something like parseint

  • I miss this warning and if I put it integer it says no valid. I'm going to try first by storing it as I had it then what store parsing it.

I confirm with this image that I am using VS and apart I ask myself why this time this error comes out, I do not see that it sends null values, and previously it was for the; others

    
asked by Vicete Geovanny Franco Siles 25.11.2016 в 15:04
source

2 answers

2

As you seem to be using VB.NET, you can use Integer.Parse .

Example:

Me.registro.edad = Integer.Parse(txtedad.Text)
    
answered by 25.11.2016 / 15:10
source
0

Use int.parse

Example:

Me.registro.edad = int.Parse(txtedad.Text);

Review the following MSDN reference for more information.

    
answered by 25.11.2016 в 15:09