3.3.11

Accessing Text Box content

I have seen the below query in a popular forum. Thought of writing something on this. This is the below query,

Conversion failed when converting the varchar value 'System.Web.UI.WebControls.TextBox' to data type int.

I cant understand why it will occur,i insert the data regarding to the correct datatype only

The guy is trying to access the text box value and he want to convert the value to integer.

Guessing, he is trying to get the value 'System.Web.UI.WebControls.TextBox'. Error indicates, the guy is trying to access the textbox property instead of text box data. In turn you need to access the textbox content like textbox.text and after wards convert the same to integer.

Cheers,
Venkatesan Prabu .J
Head - www.KaaShivinfotech.com
http://venkattechnicalblog.blogspot.com/

No comments:

Post a Comment