title: c# try and catch/ error handling
body: <p>I am currently working on a program and I am finalising it by going over with error handling. I have several cases which look like:</p>
  
  <pre><code>int stockbankInput = Convert.ToInt32(Console.ReadLine());
  </code></pre>
  
  <p>Here, the user must enter either 1, 2, 3. I have tried to use an if statement to catch the error if anybody inputs a blankspace/string/character or a number that is not 1,2 or 3 but it doesn't work in the same sense as a string input. Below is what I have tried:</p>
  
  <pre><code>if(stockbankInput == null)
  {
      Console.WriteLine("Error: Please enter either 1, 2 or 3");
      stockbankInput = 0;
      goto menuRestartLine;
  }
  </code></pre>
  
  <p>However, you cannot link 'null' with an integer input, only a string. Can anybody help with this please?</p>