I have one problem when I am trying to compare two string value in grid view. it will show error:operator > cant beapplied to operands of type string and string
string x = e.Row.Cells[7].Text.Trim();
string y = e.Row.Cells[8].Text.Trim();
if (x > y)
{
C#
}
else
{
}
how to compare it ?. plz give me answer

Iftikar HussainRank #423 · 5.9K reputationPosted Aug 21, 2013, 9:55 PM EDT
You need to use String.Compare method
Regards,
Iftikar
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 21, 2013, 9:57 PM EDT
int x = Convert.ToInt32(e.Row.Cells[7].Text.Trim());
int y = Convert.ToInt32(e.Row.Cells[8].Text.Trim());
if (x > y)
{
}
else
{
}