I am trying to convert text box values in my C# application to Numeric data format saved in an MS Access database. There seems to be a couple of ways to convert text to number. For instance, Convert.ToInt32, Convert.ToInt16, Convert.ToInt64. They all seem to work. I am developing the application on a 64 bit machine running Windows 8.1 and I have no idea which type of conversion I should use. How can the following snippet be updated to adapt it to different versions of Windows?
oleCmd.Parameters.Add("@partyID", OleDbType.Numeric).Value =
Convert.ToInt32(comboBoxWorkParty.SelectedValue.ToString());
oleCmd.Parameters.Add("@projectTypeID", OleDbType.Numeric).Value =
Convert.ToInt32(comboBoxProjectType.SelectedValue.ToString());