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 works for me:
using System; namespace numberConvert { class Program { static void Main(string[] args) { string numberAsString = "8"; int numberAsInt = int.Parse(numberAsString); } } }