Good night,
I have an SQLite query which I am executing in C# using the ExecuteScalar()
command. The result in an Object
type variable which is in fact a value of type Int64. As I need to cast it to an Int32, I tried first using Convert.ToInt32
and now I am using (Int32)(Int64)Object
, 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?
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?
Thank you very much.