Could anyone tell me why this does NOT work...
Code:
if (((int) Data.ExecuteAggregate(sqlUserAuth)) == 1)
Data.ExecuteAggregate is a function that will return an object. I cast it to an int but errors out with "System.InvalidCastException: Specified cast is not valid."
The altered code below DOES work though...
Code:
if (Convert.ToInt32(Data.ExecuteAggregate(sqlUserAuth)) == 1)
I've tried to look for limitations with casting but have not found any.
Thanks in advance for your help!