When I used the following code in C#…
int totalValue = 0;
int total = 0;
totalValue = int.Parse(Session["price"].ToString()) * int.Parse(Session["day"].ToString());
// This line causes the error
totalValue += Session["IsChauffeurUsed"].ToString().Equals("Yes", StringComparer.CurrentCultureIgnoreCase) ? 80 : 0;
… I received this error :
Member ‘object.Equals(object, object)’ cannot be accessed with an instance reference; qualify it with a type name instead.
What does that error indicate?
Your argument for the second parameter of ‘Equals’ has the wrong type, so the compiler is identifying the wrong overload.
To fix it, change this:
to this: