how to convert string in int type in C#
<p>i am taking string value from textbox name txtLastAppointment no. and
 want to convert it to int and then store it in databse using Linq to sql but i am getting error "input string was not in proper format"</p>

<p>my Input string is 2.</p>

<p>My Code is.</p>

<pre><code>      objnew.lastAppointmentNo=Convert.ToInt32(txtLastAppointmenNo.Text);
</code></pre>

<p>please point out my mistake.
Thanks..</p>
