When I used the following code in C#...
int totalValue = 0;
int total = 0;
totalValue = int.Parse(Session[\"price\"].ToString()) * int.Parse(Session[\"day\"]
I know it's quite late and also may not apply to user's case directly, just adding this answer to help out those who face same issue but due to different reason.
Equal()
method of a string instance needs first argument as string
type.
So if by any chance first argument is not of string
type and is of another type let's say int
, you get the same error which can be misleading sometimes as it won't say first argument should be of type string directly.