title: How do I retrieve a data type of tinyint from MySQL in C#?
body: <p>So in C# whenever I retrieved a tinyint from my MSSQL database I used the following cast.</p>
  
  <pre><code>(int)(byte)reader["MyField"];
  </code></pre>
  
  <p>However, that cast doesn't seem to work in MySQL.</p>
  
  <p><strong>What I have tried</strong></p>
  
  <pre><code>(byte)reader["MyField"];
  </code></pre>
  
  <p>and just </p>
  
  <pre><code>(int)reader["MyField"];
  </code></pre>
  
  <p><strong>Edit 1</strong></p>
  
  <p><strong>Exception</strong></p>
  
  <pre><code>The specified cast is not valid.
  </code></pre>
  
  <p><strong>Edit 2</strong></p>
  
  <p>This is the data type.</p>
  
  <pre><code>{Name = "SByte" FullName = "System.SByte"}
  </code></pre>