ralphtrent
Programmer
Hi
I have this if statement:
What I want is, if either of the fields is "ALL" do not execute the try/catch block, but when I test, I pass in MinLives = ALL and MaxLives = 2000 and It still tries to execute the try/catch block. What am I doing wrong?
Thanks.
I have this if statement:
Code:
if ((MinLives.ToUpper() != "ALL") || (MaxLives.ToUpper() != "ALL"))
{
try
{
if (Convert.ToInt32(MinLives) < Convert.ToInt32(MaxLives))
{
sb.Append(" and ci.LIVE_LIVES between " + MinLives + " and " + MaxLives);
}
else
{
sb.Append(" and ci.LIVE_LIVES between " + MaxLives + " and " + MinLives );
}
}
catch (System.FormatException ex)
{
throw new Exception("Please select two numeric values");
}
}
What I want is, if either of the fields is "ALL" do not execute the try/catch block, but when I test, I pass in MinLives = ALL and MaxLives = 2000 and It still tries to execute the try/catch block. What am I doing wrong?
Thanks.