'CS0019 Operator '<=' cannot be applied to operands of type 'string' and 'string' this error occur when we check min !=0 and min <= maxvalue

{

        var MinValue = (from mi in db2.PackagePurchaseds select mi.CustomerDetailid).Min();
       var MaxValue = (from mi in db2.PackagePurchaseds select mi.CustomerDetailid).Max();
            var list1 = db2.PackagePurchaseds.ToList();
          foreach(var item in list1)
        {
            var check = "false";
            var listtbl1 = db2.CustomerDetails.ToList();
            var list2 = db3.acc_person.ToList();
            if( MinValue!=0 && MinValue <= MaxValue)
            {
               }

find this error when we run a loop on this min and max value



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source