Use System.Convert to convert string to Int16 : System Convert « Data Type « C# / CSharp Tutorial






using System;

class MainClass
{
    public static void Main(string[] argv)
    {
      int a = System.Convert.ToInt16("1");
      int b = System.Convert.ToInt16("2");

    }
}








2.56.System Convert
2.56.1.Use System.Convert to convert string to Int16
2.56.2.Convert a System.String into a System.Boolean using System.Convert
2.56.3.Convert.ChangeType
2.56.4.data type convert