title: SQLite & Int64 to Int32 cast in C#
body: <p>Good night,</p>
  
  <p>I have an SQLite query which I am executing in C# using the <code>ExecuteScalar()</code> command. The result in an <code>Object</code> type variable which is in fact a value of type Int64. As I need to cast it to an Int32, I tried first using <code>Convert.ToInt32</code> and now I am using <code>(Int32)(Int64)Object</code>, although I get the same performance with both. The question is that this kind of cast seems to take an additional 6ms to perform, and the method concerned is critical code which should be executed as fast as possible... Is there any way to perform this cast faster, by using, for example, bit operators or some other method?</p>
  
  <p>Just in case this is not possible, I really don't understand why the result of the query is an Int64... is there any way I can force it to be an Int32?</p>
  
  <p>Thank you very much.</p>