I have a stored procedure returning a boolean varialbe :
Here is my C# code that works when I try to return an int variable.But it doesnt work when I try it for bool.
DbCommand dbCommand = db.GetStoredProcCommand("spGetConfigureAlerts");
object o = db.ExecuteScalar(dbCommand);
bool item = o == null ? 0 : (bool)o;
return item;
I have it as shown above , but on line three it says that :
Type of conditional expression cannot be determined because there is no implicit conversion between 'int' and 'bool'
How can I solve it ?