string1 >= string2 not implemented in Linq to SQL, any workaround?

If you're looking for => which would normally be written as >= then you cannot do this directly with strings. You can get the same behaviour via CompareTo:

string1.CompareTo(string2) >= 0

In this case, the result being less than or equal to zero means that string1 would be sorted before string2 and therefore is greater.

FYI the => operator in C# is only used in the definition of lambda expressions.


string1 >= string2 is not supported in C# Linq To Sql. The String class does not override the >= operator at all. It only overrides the != and == operators. You can verify this by trying to compile the following method

public static void Example() {
  int val = "foo" >= "bar";
}

If you want to compare to Strings in LinqToSql you should be able to use the static String.Compare(string,string) method.