c# equality operator is ==
and not =
:
if (thecitytype == "City1")
More Related Contents:
- String was not recognized as a valid DateTime ” format dd/MM/yyyy”
- How to cast Object to its actual type?
- Why can’t Double be implicitly cast to Decimal
- Casting vs using the ‘as’ keyword in the CLR
- Integer summing blues, short += short problem
- How To Change DataType of a DataColumn in a DataTable?
- Generics in C#, using type of a variable as parameter [duplicate]
- What is cool about generics, why use them?
- Shorter syntax for casting from a List to a List?
- Why do these division equations result in zero?
- C# use System.Type as Generic parameter
- What is the difference between bool and Boolean types in C#
- Why isn’t Array a generic type?
- How to call generic method with a given Type object? [duplicate]
- covariance in c#
- convert double to int
- Cast class into another class or convert class to another
- How can I get the data type of a variable in C#?
- Cast LINQ result to ObservableCollection
- How to check if a class inherits another class without instantiating it? [duplicate]
- Finding the Concrete Type behind an Interface instance
- cast object with a Type variable
- What is the difference between casting and conversion? [duplicate]
- Immutable type and property in C#
- C# – Issues with boxing / unboxing / typecasting ints. I don’t understand
- Casting array to IEnumerable
- IsAssignableFrom, IsInstanceOfType and the is keyword, what is the difference?
- Build c# Generic Type definition at runtime
- When to use a Cast or Convert
- get the Type for a object declared dynamic