title: How to cast a SQL bigint to C# equivalent
body: <p>I'm trying to cast a bigint from SQL Server into its equivalent in c#, but Visual Studio keeps forcing me to try to cast it to int, which throws a 'specified cast not valid' error. I've tried to cast it to long, Int64, int, etc. What would be the proper way of doing that? My code looks like this:</p>
  
  <pre><code>var id = 0;
  
  //Omitted code
  
  if (reader.Read())
  {
      id = (int) reader["id"];
  }
  
  //More code
  </code></pre>