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?
This would do
string x = TextBoxD1.Text; int xi = Convert.ToInt32(x);
Or you can use
int xi = Int32.Parse(x);
Refer Microsoft Developer Network for more information