Hi
I am getting error - Operator == canot be applied to operands of type object and boolean
if (row["status"] == true)
{
Status = "Active";
}
Thanks
Hi
I am getting error - Operator == canot be applied to operands of type object and boolean
if (row["status"] == true)
{
Status = "Active";
}
Thanks
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Gowtham CpPosted Aug 19, 2024, 12:45 PM
Hi,
The error happens because row["status"] is an object. You need to cast it to bool like this:
Or use:
Hope this helps!