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 use either,
int i = Convert.ToInt32(TextBoxD1.Text);
or
int i = int.Parse(TextBoxD1.Text);