Isn’t an Int64 equal to a long in C#?
long is Int64 in .NET; it is just an alias in C#. Your problem is casting the return value to long and unless we know the type coming back from your query for sure, we would not know why you get an error. SQL BigInt must be convertable to long. If it is the COUNT(*) … Read more