Posted on: 2/19/2014 4:02:57 AM | Views : 660

Done a lot of googling but no resolution so here goes:
I have two textboxes in a web form that each holds a numeric input.  Validation is done in the web form to ensure only integers are pasted to the code behind via a button click event.  I have two labels on in the web form just to validate what I am passing.  In my code you will see these as label2 and label3.  The values are being passed ok. My DB has two fields/columns... UserID (int) and SPosition (int)

When I execute my code by button click event I get the following error:
System.InvalidCastException: Conversion from string "UserID" to type 'Integer' is not valid. ---> System.FormatException: Input string was not in a correct format. at Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat) at Microsoft.VisualBasic.CompilerServices.Conversions.ToIn ...

Go to the complete details ...