I have a TextBoxD1.Text and I want to convert it to an int to store it in a database.
TextBoxD1.Text
int
How can I do this?
You can try the following. It will work:
int x = Convert.ToInt32(TextBoxD1.Text);
The string value in the variable TextBoxD1.Text will be converted into Int32 and will be stored in x.