Please solve this.

Discussion in 'ASP .Net' started by bbawa1@yahoo.com, Jun 21, 2007.

  1. Guest

    It says invalid expression term &&

    protected void GridView1_RowDataBound(object sender,
    GridViewRowEventArgs e)
    {

    if
    ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    {

    e.Row.Cells[0].CssClass = "sdgStatusOrange";

    }

    It says invalid expression term &&
    , Jun 21, 2007
    #1
    1. Advertising

  2. Turkbear Guest

    On Thu, 21 Jun 2007 13:19:41 -0700, wrote:

    > It says invalid expression term &&
    >
    > protected void GridView1_RowDataBound(object sender,
    >GridViewRowEventArgs e)
    > {
    >
    >if
    >((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >{
    >
    > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >
    >}
    >
    >It says invalid expression term &&


    Check the parens ( maybe):
    if
    ((Convert.ToInt32(e.Row.Cells[2].Text)>=15)&& (Convert.ToInt32(e.Row.Cells[2].Text)>=17)) ;
    {

    e.Row.Cells[0].CssClass = "sdgStatusOrange";
    }
    Turkbear, Jun 21, 2007
    #2
    1. Advertising

  3. Mark Rae Guest

    <> wrote in message
    news:...
    > It says invalid expression term &&
    >
    > protected void GridView1_RowDataBound(object sender,
    > GridViewRowEventArgs e)
    > {
    >
    > if
    > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > {
    >
    > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >
    > }
    >
    > It says invalid expression term &&


    You've got your parentheses slightly confused:

    if((Convert.ToInt32(e.Row.Cells[2].Text)>=15)&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17))



    --
    http://www.markrae.net
    Mark Rae, Jun 21, 2007
    #3
  4. re:
    ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);

    You need to use the "regular" AND operator.

    Try :

    ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);

    If you use && and e.Row.Cells[2].Text)>=15 is false, e.Row.Cells[2].Text)>=17
    is not evaluated (because the result of the AND operation is false no matter what the
    value of e.Row.Cells[2].Text)>=17 may be).

    This is known as "short-circuit" evaluation...but it requires *both* operands to be true.
    In your code, that is not alsways the case.






    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    <> wrote in message news:...
    > It says invalid expression term &&
    >
    > protected void GridView1_RowDataBound(object sender,
    > GridViewRowEventArgs e)
    > {
    >
    > if
    > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > {
    >
    > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >
    > }
    >
    > It says invalid expression term &&
    >
    Juan T. Llibre, Jun 21, 2007
    #4
  5. The problem is a bit more than just misplaced parens.
    See my just-sent explanation.




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "Turkbear" <> wrote in message news:...
    > On Thu, 21 Jun 2007 13:19:41 -0700, wrote:
    >
    >> It says invalid expression term &&
    >>
    >> protected void GridView1_RowDataBound(object sender,
    >>GridViewRowEventArgs e)
    >> {
    >>
    >>if
    >>((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >>{
    >>
    >> e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >>
    >>}
    >>
    >>It says invalid expression term &&

    >
    > Check the parens ( maybe):
    > if
    > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15)&& (Convert.ToInt32(e.Row.Cells[2].Text)>=17)) ;
    > {
    >
    > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > }
    Juan T. Llibre, Jun 21, 2007
    #5
  6. Hi Juan,

    In this case, "invalid expression term &&" is caused definitely by misplaced
    parentheses, because it is a compiler message ;-) (evaluation would be done
    at the runtime). Second, bitwise and & operator will give the same result
    (apart from the fact short-circuit is not apllicable) because true & true =
    true, false & true = false, false & false = false. Therefore, it should be
    corrected to:

    if (
    (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    {
    e.Row.Cells[0].CssClass = "sdgStatusOrange";
    }

    Best regards
    --
    Milosz


    "Juan T. Llibre" wrote:

    > re:
    > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >
    > You need to use the "regular" AND operator.
    >
    > Try :
    >
    > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >
    > If you use && and e.Row.Cells[2].Text)>=15 is false, e.Row.Cells[2].Text)>=17
    > is not evaluated (because the result of the AND operation is false no matter what the
    > value of e.Row.Cells[2].Text)>=17 may be).
    >
    > This is known as "short-circuit" evaluation...but it requires *both* operands to be true.
    > In your code, that is not alsways the case.
    >
    >
    >
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ======================================
    > <> wrote in message news:...
    > > It says invalid expression term &&
    > >
    > > protected void GridView1_RowDataBound(object sender,
    > > GridViewRowEventArgs e)
    > > {
    > >
    > > if
    > > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > > {
    > >
    > > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > >
    > > }
    > >
    > > It says invalid expression term &&
    > >

    >
    >
    >
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Jun 22, 2007
    #6
  7. Hi, Milosz,

    In that case, what happens if Convert.ToInt32(e.Row.Cells[2].Text = 14) ?




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "Milosz Skalecki [MCAD]" <> wrote in message
    news:...
    > Hi Juan,
    >
    > In this case, "invalid expression term &&" is caused definitely by misplaced
    > parentheses, because it is a compiler message ;-) (evaluation would be done
    > at the runtime). Second, bitwise and & operator will give the same result
    > (apart from the fact short-circuit is not apllicable) because true & true =
    > true, false & true = false, false & false = false. Therefore, it should be
    > corrected to:
    >
    > if (
    > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    > {
    > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > }
    >
    > Best regards
    > --
    > Milosz
    >
    >
    > "Juan T. Llibre" wrote:
    >
    >> re:
    >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >>
    >> You need to use the "regular" AND operator.
    >>
    >> Try :
    >>
    >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >>
    >> If you use && and e.Row.Cells[2].Text)>=15 is false, e.Row.Cells[2].Text)>=17
    >> is not evaluated (because the result of the AND operation is false no matter what the
    >> value of e.Row.Cells[2].Text)>=17 may be).
    >>
    >> This is known as "short-circuit" evaluation...but it requires *both* operands to be true.
    >> In your code, that is not alsways the case.
    >>
    >>
    >>
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ======================================
    >> <> wrote in message news:...
    >> > It says invalid expression term &&
    >> >
    >> > protected void GridView1_RowDataBound(object sender,
    >> > GridViewRowEventArgs e)
    >> > {
    >> >
    >> > if
    >> > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> > {
    >> >
    >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> >
    >> > }
    >> >
    >> > It says invalid expression term &&
    >> >

    >>
    >>
    >>
    Juan T. Llibre, Jun 22, 2007
    #7
  8. Good morning Juan

    Did you mean if the text in cell equals "14"

    if (
    (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    {
    e.Row.Cells[0].CssClass = "sdgStatusOrange";
    }

    then statement inside is not going to be reached, simply because the first
    condition is false, and short-circuit evaluation for && operator skips the
    second operand. I understand your confusion as I have seen this guy's
    previous post, but in this case it was just misplaced parentheses ;-)
    --
    Milosz


    "Juan T. Llibre" wrote:

    > Hi, Milosz,
    >
    > In that case, what happens if Convert.ToInt32(e.Row.Cells[2].Text = 14) ?
    >
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ======================================
    > "Milosz Skalecki [MCAD]" <> wrote in message
    > news:...
    > > Hi Juan,
    > >
    > > In this case, "invalid expression term &&" is caused definitely by misplaced
    > > parentheses, because it is a compiler message ;-) (evaluation would be done
    > > at the runtime). Second, bitwise and & operator will give the same result
    > > (apart from the fact short-circuit is not apllicable) because true & true =
    > > true, false & true = false, false & false = false. Therefore, it should be
    > > corrected to:
    > >
    > > if (
    > > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    > > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    > > {
    > > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > > }
    > >
    > > Best regards
    > > --
    > > Milosz
    > >
    > >
    > > "Juan T. Llibre" wrote:
    > >
    > >> re:
    > >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > >>
    > >> You need to use the "regular" AND operator.
    > >>
    > >> Try :
    > >>
    > >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > >>
    > >> If you use && and e.Row.Cells[2].Text)>=15 is false, e.Row.Cells[2].Text)>=17
    > >> is not evaluated (because the result of the AND operation is false no matter what the
    > >> value of e.Row.Cells[2].Text)>=17 may be).
    > >>
    > >> This is known as "short-circuit" evaluation...but it requires *both* operands to be true.
    > >> In your code, that is not alsways the case.
    > >>
    > >>
    > >>
    > >>
    > >>
    > >>
    > >> Juan T. Llibre, asp.net MVP
    > >> asp.net faq : http://asp.net.do/faq/
    > >> foros de asp.net, en español : http://asp.net.do/foros/
    > >> ======================================
    > >> <> wrote in message news:...
    > >> > It says invalid expression term &&
    > >> >
    > >> > protected void GridView1_RowDataBound(object sender,
    > >> > GridViewRowEventArgs e)
    > >> > {
    > >> >
    > >> > if
    > >> > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > >> > {
    > >> >
    > >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > >> >
    > >> > }
    > >> >
    > >> > It says invalid expression term &&
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Jun 22, 2007
    #8
  9. re:
    !> Did you mean if the text in cell equals "14"

    Yes.

    re:
    !> then statement inside is not going to be reached, simply because the first
    !> condition is false, and short-circuit evaluation for && operator skips the second operand.

    That's exactly what I explained...and that's an undesirable "feature".
    That's why he needs to change the operator.

    re:
    !> I understand your confusion

    There's no confusion.

    He should change both the parens *and* the operator,
    the first as you suggest; the second as I suggest.

    Doing that will cover all the bases for him.




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "Milosz Skalecki [MCAD]" <> wrote in message
    news:...
    > Good morning Juan
    >
    > Did you mean if the text in cell equals "14"
    >
    > if (
    > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    > {
    > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > }
    >
    > then statement inside is not going to be reached, simply because the first
    > condition is false, and short-circuit evaluation for && operator skips the
    > second operand. I understand your confusion as I have seen this guy's
    > previous post, but in this case it was just misplaced parentheses ;-)
    > --
    > Milosz
    >
    >
    > "Juan T. Llibre" wrote:
    >
    >> Hi, Milosz,
    >>
    >> In that case, what happens if Convert.ToInt32(e.Row.Cells[2].Text = 14) ?
    >>
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ======================================
    >> "Milosz Skalecki [MCAD]" <> wrote in message
    >> news:...
    >> > Hi Juan,
    >> >
    >> > In this case, "invalid expression term &&" is caused definitely by misplaced
    >> > parentheses, because it is a compiler message ;-) (evaluation would be done
    >> > at the runtime). Second, bitwise and & operator will give the same result
    >> > (apart from the fact short-circuit is not apllicable) because true & true =
    >> > true, false & true = false, false & false = false. Therefore, it should be
    >> > corrected to:
    >> >
    >> > if (
    >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    >> > {
    >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> > }
    >> >
    >> > Best regards
    >> > --
    >> > Milosz
    >> >
    >> >
    >> > "Juan T. Llibre" wrote:
    >> >
    >> >> re:
    >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> >>
    >> >> You need to use the "regular" AND operator.
    >> >>
    >> >> Try :
    >> >>
    >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> >>
    >> >> If you use && and e.Row.Cells[2].Text)>=15 is false, e.Row.Cells[2].Text)>=17
    >> >> is not evaluated (because the result of the AND operation is false no matter what the
    >> >> value of e.Row.Cells[2].Text)>=17 may be).
    >> >>
    >> >> This is known as "short-circuit" evaluation...but it requires *both* operands to be true.
    >> >> In your code, that is not alsways the case.
    >> >>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >>
    >> >> Juan T. Llibre, asp.net MVP
    >> >> asp.net faq : http://asp.net.do/faq/
    >> >> foros de asp.net, en español : http://asp.net.do/foros/
    >> >> ======================================
    >> >> <> wrote in message
    >> >> news:...
    >> >> > It says invalid expression term &&
    >> >> >
    >> >> > protected void GridView1_RowDataBound(object sender,
    >> >> > GridViewRowEventArgs e)
    >> >> > {
    >> >> >
    >> >> > if
    >> >> > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> >> > {
    >> >> >
    >> >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> >> >
    >> >> > }
    >> >> >
    >> >> > It says invalid expression term &&
    >> >> >
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
    Juan T. Llibre, Jun 22, 2007
    #9
  10. Juan,

    Come on, i can't see any logical exlanation in changing && operator to & for
    this case :). First of all, logically, his "if" statement could be
    simplified changed to:
    if (Convert.ToInt32(e.Row.Cells[2].Text) >= 17)
    {
    e.Row.Cells[0].CssClass = "sdgStatusOrange";
    }
    simply because the only numbers that meet both criteria are >= 17. Second,
    if the first operand (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) would
    return false, second could not be true (logically). Please also note he used
    && therefore there is not point to test the second operand as you're trying
    to point out. Third, it was definitely compiler error (syntax error) which
    has nothing to do with runtime evaluation.

    Take it easy mate ;-)

    Best regards
    --
    Milosz


    "Juan T. Llibre" wrote:

    > re:
    > !> Did you mean if the text in cell equals "14"
    >
    > Yes.
    >
    > re:
    > !> then statement inside is not going to be reached, simply because the first
    > !> condition is false, and short-circuit evaluation for && operator skips the second operand.
    >
    > That's exactly what I explained...and that's an undesirable "feature".
    > That's why he needs to change the operator.
    >
    > re:
    > !> I understand your confusion
    >
    > There's no confusion.
    >
    > He should change both the parens *and* the operator,
    > the first as you suggest; the second as I suggest.
    >
    > Doing that will cover all the bases for him.
    >
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ======================================
    > "Milosz Skalecki [MCAD]" <> wrote in message
    > news:...
    > > Good morning Juan
    > >
    > > Did you mean if the text in cell equals "14"
    > >
    > > if (
    > > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    > > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    > > {
    > > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > > }
    > >
    > > then statement inside is not going to be reached, simply because the first
    > > condition is false, and short-circuit evaluation for && operator skips the
    > > second operand. I understand your confusion as I have seen this guy's
    > > previous post, but in this case it was just misplaced parentheses ;-)
    > > --
    > > Milosz
    > >
    > >
    > > "Juan T. Llibre" wrote:
    > >
    > >> Hi, Milosz,
    > >>
    > >> In that case, what happens if Convert.ToInt32(e.Row.Cells[2].Text = 14) ?
    > >>
    > >>
    > >>
    > >>
    > >> Juan T. Llibre, asp.net MVP
    > >> asp.net faq : http://asp.net.do/faq/
    > >> foros de asp.net, en español : http://asp.net.do/foros/
    > >> ======================================
    > >> "Milosz Skalecki [MCAD]" <> wrote in message
    > >> news:...
    > >> > Hi Juan,
    > >> >
    > >> > In this case, "invalid expression term &&" is caused definitely by misplaced
    > >> > parentheses, because it is a compiler message ;-) (evaluation would be done
    > >> > at the runtime). Second, bitwise and & operator will give the same result
    > >> > (apart from the fact short-circuit is not apllicable) because true & true =
    > >> > true, false & true = false, false & false = false. Therefore, it should be
    > >> > corrected to:
    > >> >
    > >> > if (
    > >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    > >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    > >> > {
    > >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > >> > }
    > >> >
    > >> > Best regards
    > >> > --
    > >> > Milosz
    > >> >
    > >> >
    > >> > "Juan T. Llibre" wrote:
    > >> >
    > >> >> re:
    > >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > >> >>
    > >> >> You need to use the "regular" AND operator.
    > >> >>
    > >> >> Try :
    > >> >>
    > >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > >> >>
    > >> >> If you use && and e.Row.Cells[2].Text)>=15 is false, e.Row.Cells[2].Text)>=17
    > >> >> is not evaluated (because the result of the AND operation is false no matter what the
    > >> >> value of e.Row.Cells[2].Text)>=17 may be).
    > >> >>
    > >> >> This is known as "short-circuit" evaluation...but it requires *both* operands to be true.
    > >> >> In your code, that is not alsways the case.
    > >> >>
    > >> >>
    > >> >>
    > >> >>
    > >> >>
    > >> >>
    > >> >> Juan T. Llibre, asp.net MVP
    > >> >> asp.net faq : http://asp.net.do/faq/
    > >> >> foros de asp.net, en español : http://asp.net.do/foros/
    > >> >> ======================================
    > >> >> <> wrote in message
    > >> >> news:...
    > >> >> > It says invalid expression term &&
    > >> >> >
    > >> >> > protected void GridView1_RowDataBound(object sender,
    > >> >> > GridViewRowEventArgs e)
    > >> >> > {
    > >> >> >
    > >> >> > if
    > >> >> > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > >> >> > {
    > >> >> >
    > >> >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > >> >> >
    > >> >> > }
    > >> >> >
    > >> >> > It says invalid expression term &&
    > >> >> >
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Jun 22, 2007
    #10
  11. Mark Rae Guest

    "Milosz Skalecki [MCAD]" <> wrote in message
    news:...

    > Take it easy mate ;-)


    <puts down the mouse and walks slowly away from the computer...>


    --
    http://www.markrae.net
    Mark Rae, Jun 22, 2007
    #11
  12. ;-)
    --
    Milosz


    "Mark Rae" wrote:

    > "Milosz Skalecki [MCAD]" <> wrote in message
    > news:...
    >
    > > Take it easy mate ;-)

    >
    > <puts down the mouse and walks slowly away from the computer...>
    >
    >
    > --
    > http://www.markrae.net
    >
    >
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Jun 22, 2007
    #12
  13. re:
    !> Take it easy mate ;-)

    Has anything I've written implied that I'm not ?

    ;-)

    re:
    !> his "if" statement could be simplified changed to:

    I agree, but the problem, *as stated*, won't be resolved just by changing the parens,
    because, if the condition (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) is *false*,
    changing the parens won't help him.

    He needs to do both what you suggested *and* what I suggested,
    if the original conditions remain as stated by him.

    Whether he should change his conditions, and not leave them as stated, is another issue.

    ;-)

    re:
    !> also note he used && therefore there is not point to test the second operand

    Again, what if the first operand is false ?





    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "Milosz Skalecki [MCAD]" <> wrote in message
    news:...
    > Juan,
    >
    > Come on, i can't see any logical exlanation in changing && operator to & for
    > this case :). First of all, logically, his "if" statement could be
    > simplified changed to:
    > if (Convert.ToInt32(e.Row.Cells[2].Text) >= 17)
    > {
    > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > }
    > simply because the only numbers that meet both criteria are >= 17. Second,
    > if the first operand (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) would
    > return false, second could not be true (logically). Please also note he used
    > && therefore there is not point to test the second operand as you're trying
    > to point out. Third, it was definitely compiler error (syntax error) which
    > has nothing to do with runtime evaluation.
    >
    > Take it easy mate ;-)
    >
    > Best regards
    > --
    > Milosz
    >
    >
    > "Juan T. Llibre" wrote:
    >
    >> re:
    >> !> Did you mean if the text in cell equals "14"
    >>
    >> Yes.
    >>
    >> re:
    >> !> then statement inside is not going to be reached, simply because the first
    >> !> condition is false, and short-circuit evaluation for && operator skips the second operand.
    >>
    >> That's exactly what I explained...and that's an undesirable "feature".
    >> That's why he needs to change the operator.
    >>
    >> re:
    >> !> I understand your confusion
    >>
    >> There's no confusion.
    >>
    >> He should change both the parens *and* the operator,
    >> the first as you suggest; the second as I suggest.
    >>
    >> Doing that will cover all the bases for him.
    >>
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ======================================
    >> "Milosz Skalecki [MCAD]" <> wrote in message
    >> news:...
    >> > Good morning Juan
    >> >
    >> > Did you mean if the text in cell equals "14"
    >> >
    >> > if (
    >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    >> > {
    >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> > }
    >> >
    >> > then statement inside is not going to be reached, simply because the first
    >> > condition is false, and short-circuit evaluation for && operator skips the
    >> > second operand. I understand your confusion as I have seen this guy's
    >> > previous post, but in this case it was just misplaced parentheses ;-)
    >> > --
    >> > Milosz
    >> >
    >> >
    >> > "Juan T. Llibre" wrote:
    >> >
    >> >> Hi, Milosz,
    >> >>
    >> >> In that case, what happens if Convert.ToInt32(e.Row.Cells[2].Text = 14) ?
    >> >>
    >> >>
    >> >>
    >> >>
    >> >> Juan T. Llibre, asp.net MVP
    >> >> asp.net faq : http://asp.net.do/faq/
    >> >> foros de asp.net, en español : http://asp.net.do/foros/
    >> >> ======================================
    >> >> "Milosz Skalecki [MCAD]" <> wrote in message
    >> >> news:...
    >> >> > Hi Juan,
    >> >> >
    >> >> > In this case, "invalid expression term &&" is caused definitely by misplaced
    >> >> > parentheses, because it is a compiler message ;-) (evaluation would be done
    >> >> > at the runtime). Second, bitwise and & operator will give the same result
    >> >> > (apart from the fact short-circuit is not apllicable) because true & true =
    >> >> > true, false & true = false, false & false = false. Therefore, it should be
    >> >> > corrected to:
    >> >> >
    >> >> > if (
    >> >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    >> >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    >> >> > {
    >> >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> >> > }
    >> >> >
    >> >> > Best regards
    >> >> > --
    >> >> > Milosz
    >> >> >
    >> >> >
    >> >> > "Juan T. Llibre" wrote:
    >> >> >
    >> >> >> re:
    >> >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> >> >>
    >> >> >> You need to use the "regular" AND operator.
    >> >> >>
    >> >> >> Try :
    >> >> >>
    >> >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> >> >>
    >> >> >> If you use && and e.Row.Cells[2].Text)>=15 is false, e.Row.Cells[2].Text)>=17
    >> >> >> is not evaluated (because the result of the AND operation is false no matter what the
    >> >> >> value of e.Row.Cells[2].Text)>=17 may be).
    >> >> >>
    >> >> >> This is known as "short-circuit" evaluation...but it requires *both* operands to be true.
    >> >> >> In your code, that is not alsways the case.
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >> Juan T. Llibre, asp.net MVP
    >> >> >> asp.net faq : http://asp.net.do/faq/
    >> >> >> foros de asp.net, en español : http://asp.net.do/foros/
    >> >> >> ======================================
    >> >> >> <> wrote in message
    >> >> >> news:...
    >> >> >> > It says invalid expression term &&
    >> >> >> >
    >> >> >> > protected void GridView1_RowDataBound(object sender,
    >> >> >> > GridViewRowEventArgs e)
    >> >> >> > {
    >> >> >> >
    >> >> >> > if
    >> >> >> > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> >> >> > {
    >> >> >> >
    >> >> >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> >> >> >
    >> >> >> > }
    >> >> >> >
    >> >> >> > It says invalid expression term &&
    >> >> >> >
    >> >> >>
    >> >> >>
    >> >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
    Juan T. Llibre, Jun 22, 2007
    #13
  14. Howdy Juan,

    I just wanted to point out that applying & instead of && wouldn't change
    anything, because he's had syntax error.

    > Again, what if the first operand is false ?


    I have answered this question already. For both operators (&& and &) you
    will get the same result.

    1. && operator

    Let simplify it

    string str = "12";

    (Convert.ToInt32(str) >= 15) &&
    (Convert.ToInt32(str) >= 17))

    cis equivalent to

    (12 >= 15) && (12 >= 17)
    false && false = false

    please note it apllies for shortcirtuit evaluation as well

    2. & operator

    false & false = false

    which is the same result.

    As you can see apllying the only difference between && and & for logical
    arguments is that bitwise AND does not use short circuit evaluation.

    That's why forcing second operand to be evaluated would not change anything
    at all.

    Hope it is clear now.

    Best regards Juan
    --
    Milosz


    "Juan T. Llibre" wrote:

    > re:
    > !> Take it easy mate ;-)
    >
    > Has anything I've written implied that I'm not ?
    >
    > ;-)
    >
    > re:
    > !> his "if" statement could be simplified changed to:
    >
    > I agree, but the problem, *as stated*, won't be resolved just by changing the parens,
    > because, if the condition (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) is *false*,
    > changing the parens won't help him.
    >
    > He needs to do both what you suggested *and* what I suggested,
    > if the original conditions remain as stated by him.
    >
    > Whether he should change his conditions, and not leave them as stated, is another issue.
    >
    > ;-)
    >
    > re:
    > !> also note he used && therefore there is not point to test the second operand
    >
    > Again, what if the first operand is false ?
    >
    >
    >
    >
    >
    > Juan T. Llibre, asp.net MVP
    > asp.net faq : http://asp.net.do/faq/
    > foros de asp.net, en español : http://asp.net.do/foros/
    > ======================================
    > "Milosz Skalecki [MCAD]" <> wrote in message
    > news:...
    > > Juan,
    > >
    > > Come on, i can't see any logical exlanation in changing && operator to & for
    > > this case :). First of all, logically, his "if" statement could be
    > > simplified changed to:
    > > if (Convert.ToInt32(e.Row.Cells[2].Text) >= 17)
    > > {
    > > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > > }
    > > simply because the only numbers that meet both criteria are >= 17. Second,
    > > if the first operand (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) would
    > > return false, second could not be true (logically). Please also note he used
    > > && therefore there is not point to test the second operand as you're trying
    > > to point out. Third, it was definitely compiler error (syntax error) which
    > > has nothing to do with runtime evaluation.
    > >
    > > Take it easy mate ;-)
    > >
    > > Best regards
    > > --
    > > Milosz
    > >
    > >
    > > "Juan T. Llibre" wrote:
    > >
    > >> re:
    > >> !> Did you mean if the text in cell equals "14"
    > >>
    > >> Yes.
    > >>
    > >> re:
    > >> !> then statement inside is not going to be reached, simply because the first
    > >> !> condition is false, and short-circuit evaluation for && operator skips the second operand.
    > >>
    > >> That's exactly what I explained...and that's an undesirable "feature".
    > >> That's why he needs to change the operator.
    > >>
    > >> re:
    > >> !> I understand your confusion
    > >>
    > >> There's no confusion.
    > >>
    > >> He should change both the parens *and* the operator,
    > >> the first as you suggest; the second as I suggest.
    > >>
    > >> Doing that will cover all the bases for him.
    > >>
    > >>
    > >>
    > >>
    > >> Juan T. Llibre, asp.net MVP
    > >> asp.net faq : http://asp.net.do/faq/
    > >> foros de asp.net, en español : http://asp.net.do/foros/
    > >> ======================================
    > >> "Milosz Skalecki [MCAD]" <> wrote in message
    > >> news:...
    > >> > Good morning Juan
    > >> >
    > >> > Did you mean if the text in cell equals "14"
    > >> >
    > >> > if (
    > >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    > >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    > >> > {
    > >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > >> > }
    > >> >
    > >> > then statement inside is not going to be reached, simply because the first
    > >> > condition is false, and short-circuit evaluation for && operator skips the
    > >> > second operand. I understand your confusion as I have seen this guy's
    > >> > previous post, but in this case it was just misplaced parentheses ;-)
    > >> > --
    > >> > Milosz
    > >> >
    > >> >
    > >> > "Juan T. Llibre" wrote:
    > >> >
    > >> >> Hi, Milosz,
    > >> >>
    > >> >> In that case, what happens if Convert.ToInt32(e.Row.Cells[2].Text = 14) ?
    > >> >>
    > >> >>
    > >> >>
    > >> >>
    > >> >> Juan T. Llibre, asp.net MVP
    > >> >> asp.net faq : http://asp.net.do/faq/
    > >> >> foros de asp.net, en español : http://asp.net.do/foros/
    > >> >> ======================================
    > >> >> "Milosz Skalecki [MCAD]" <> wrote in message
    > >> >> news:...
    > >> >> > Hi Juan,
    > >> >> >
    > >> >> > In this case, "invalid expression term &&" is caused definitely by misplaced
    > >> >> > parentheses, because it is a compiler message ;-) (evaluation would be done
    > >> >> > at the runtime). Second, bitwise and & operator will give the same result
    > >> >> > (apart from the fact short-circuit is not apllicable) because true & true =
    > >> >> > true, false & true = false, false & false = false. Therefore, it should be
    > >> >> > corrected to:
    > >> >> >
    > >> >> > if (
    > >> >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    > >> >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    > >> >> > {
    > >> >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > >> >> > }
    > >> >> >
    > >> >> > Best regards
    > >> >> > --
    > >> >> > Milosz
    > >> >> >
    > >> >> >
    > >> >> > "Juan T. Llibre" wrote:
    > >> >> >
    > >> >> >> re:
    > >> >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > >> >> >>
    > >> >> >> You need to use the "regular" AND operator.
    > >> >> >>
    > >> >> >> Try :
    > >> >> >>
    > >> >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > >> >> >>
    > >> >> >> If you use && and e.Row.Cells[2].Text)>=15 is false, e.Row.Cells[2].Text)>=17
    > >> >> >> is not evaluated (because the result of the AND operation is false no matter what the
    > >> >> >> value of e.Row.Cells[2].Text)>=17 may be).
    > >> >> >>
    > >> >> >> This is known as "short-circuit" evaluation...but it requires *both* operands to be true.
    > >> >> >> In your code, that is not alsways the case.
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >> >> Juan T. Llibre, asp.net MVP
    > >> >> >> asp.net faq : http://asp.net.do/faq/
    > >> >> >> foros de asp.net, en español : http://asp.net.do/foros/
    > >> >> >> ======================================
    > >> >> >> <> wrote in message
    > >> >> >> news:...
    > >> >> >> > It says invalid expression term &&
    > >> >> >> >
    > >> >> >> > protected void GridView1_RowDataBound(object sender,
    > >> >> >> > GridViewRowEventArgs e)
    > >> >> >> > {
    > >> >> >> >
    > >> >> >> > if
    > >> >> >> > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    > >> >> >> > {
    > >> >> >> >
    > >> >> >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    > >> >> >> >
    > >> >> >> > }
    > >> >> >> >
    > >> >> >> > It says invalid expression term &&
    > >> >> >> >
    > >> >> >>
    > >> >> >>
    > >> >> >>
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=, Jun 22, 2007
    #14
  15. Thanks for clearing that up, Milosz.




    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en español : http://asp.net.do/foros/
    ======================================
    "Milosz Skalecki [MCAD]" <> wrote in message
    news:...
    > Howdy Juan,
    >
    > I just wanted to point out that applying & instead of && wouldn't change
    > anything, because he's had syntax error.
    >
    >> Again, what if the first operand is false ?

    >
    > I have answered this question already. For both operators (&& and &) you
    > will get the same result.
    >
    > 1. && operator
    >
    > Let simplify it
    >
    > string str = "12";
    >
    > (Convert.ToInt32(str) >= 15) &&
    > (Convert.ToInt32(str) >= 17))
    >
    > cis equivalent to
    >
    > (12 >= 15) && (12 >= 17)
    > false && false = false
    >
    > please note it apllies for shortcirtuit evaluation as well
    >
    > 2. & operator
    >
    > false & false = false
    >
    > which is the same result.
    >
    > As you can see apllying the only difference between && and & for logical
    > arguments is that bitwise AND does not use short circuit evaluation.
    >
    > That's why forcing second operand to be evaluated would not change anything
    > at all.
    >
    > Hope it is clear now.
    >
    > Best regards Juan
    > --
    > Milosz
    >
    >
    > "Juan T. Llibre" wrote:
    >
    >> re:
    >> !> Take it easy mate ;-)
    >>
    >> Has anything I've written implied that I'm not ?
    >>
    >> ;-)
    >>
    >> re:
    >> !> his "if" statement could be simplified changed to:
    >>
    >> I agree, but the problem, *as stated*, won't be resolved just by changing the parens,
    >> because, if the condition (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) is *false*,
    >> changing the parens won't help him.
    >>
    >> He needs to do both what you suggested *and* what I suggested,
    >> if the original conditions remain as stated by him.
    >>
    >> Whether he should change his conditions, and not leave them as stated, is another issue.
    >>
    >> ;-)
    >>
    >> re:
    >> !> also note he used && therefore there is not point to test the second operand
    >>
    >> Again, what if the first operand is false ?
    >>
    >>
    >>
    >>
    >>
    >> Juan T. Llibre, asp.net MVP
    >> asp.net faq : http://asp.net.do/faq/
    >> foros de asp.net, en español : http://asp.net.do/foros/
    >> ======================================
    >> "Milosz Skalecki [MCAD]" <> wrote in message
    >> news:...
    >> > Juan,
    >> >
    >> > Come on, i can't see any logical exlanation in changing && operator to & for
    >> > this case :). First of all, logically, his "if" statement could be
    >> > simplified changed to:
    >> > if (Convert.ToInt32(e.Row.Cells[2].Text) >= 17)
    >> > {
    >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> > }
    >> > simply because the only numbers that meet both criteria are >= 17. Second,
    >> > if the first operand (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) would
    >> > return false, second could not be true (logically). Please also note he used
    >> > && therefore there is not point to test the second operand as you're trying
    >> > to point out. Third, it was definitely compiler error (syntax error) which
    >> > has nothing to do with runtime evaluation.
    >> >
    >> > Take it easy mate ;-)
    >> >
    >> > Best regards
    >> > --
    >> > Milosz
    >> >
    >> >
    >> > "Juan T. Llibre" wrote:
    >> >
    >> >> re:
    >> >> !> Did you mean if the text in cell equals "14"
    >> >>
    >> >> Yes.
    >> >>
    >> >> re:
    >> >> !> then statement inside is not going to be reached, simply because the first
    >> >> !> condition is false, and short-circuit evaluation for && operator skips the second operand.
    >> >>
    >> >> That's exactly what I explained...and that's an undesirable "feature".
    >> >> That's why he needs to change the operator.
    >> >>
    >> >> re:
    >> >> !> I understand your confusion
    >> >>
    >> >> There's no confusion.
    >> >>
    >> >> He should change both the parens *and* the operator,
    >> >> the first as you suggest; the second as I suggest.
    >> >>
    >> >> Doing that will cover all the bases for him.
    >> >>
    >> >>
    >> >>
    >> >>
    >> >> Juan T. Llibre, asp.net MVP
    >> >> asp.net faq : http://asp.net.do/faq/
    >> >> foros de asp.net, en español : http://asp.net.do/foros/
    >> >> ======================================
    >> >> "Milosz Skalecki [MCAD]" <> wrote in message
    >> >> news:...
    >> >> > Good morning Juan
    >> >> >
    >> >> > Did you mean if the text in cell equals "14"
    >> >> >
    >> >> > if (
    >> >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    >> >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    >> >> > {
    >> >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> >> > }
    >> >> >
    >> >> > then statement inside is not going to be reached, simply because the first
    >> >> > condition is false, and short-circuit evaluation for && operator skips the
    >> >> > second operand. I understand your confusion as I have seen this guy's
    >> >> > previous post, but in this case it was just misplaced parentheses ;-)
    >> >> > --
    >> >> > Milosz
    >> >> >
    >> >> >
    >> >> > "Juan T. Llibre" wrote:
    >> >> >
    >> >> >> Hi, Milosz,
    >> >> >>
    >> >> >> In that case, what happens if Convert.ToInt32(e.Row.Cells[2].Text = 14) ?
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >> >> Juan T. Llibre, asp.net MVP
    >> >> >> asp.net faq : http://asp.net.do/faq/
    >> >> >> foros de asp.net, en español : http://asp.net.do/foros/
    >> >> >> ======================================
    >> >> >> "Milosz Skalecki [MCAD]" <> wrote in message
    >> >> >> news:...
    >> >> >> > Hi Juan,
    >> >> >> >
    >> >> >> > In this case, "invalid expression term &&" is caused definitely by misplaced
    >> >> >> > parentheses, because it is a compiler message ;-) (evaluation would be done
    >> >> >> > at the runtime). Second, bitwise and & operator will give the same result
    >> >> >> > (apart from the fact short-circuit is not apllicable) because true & true =
    >> >> >> > true, false & true = false, false & false = false. Therefore, it should be
    >> >> >> > corrected to:
    >> >> >> >
    >> >> >> > if (
    >> >> >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 15) &&
    >> >> >> > (Convert.ToInt32(e.Row.Cells[2].Text) >= 17))
    >> >> >> > {
    >> >> >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> >> >> > }
    >> >> >> >
    >> >> >> > Best regards
    >> >> >> > --
    >> >> >> > Milosz
    >> >> >> >
    >> >> >> >
    >> >> >> > "Juan T. Llibre" wrote:
    >> >> >> >
    >> >> >> >> re:
    >> >> >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> >> >> >>
    >> >> >> >> You need to use the "regular" AND operator.
    >> >> >> >>
    >> >> >> >> Try :
    >> >> >> >>
    >> >> >> >> ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> >> >> >>
    >> >> >> >> If you use && and e.Row.Cells[2].Text)>=15 is false, e.Row.Cells[2].Text)>=17
    >> >> >> >> is not evaluated (because the result of the AND operation is false no matter what the
    >> >> >> >> value of e.Row.Cells[2].Text)>=17 may be).
    >> >> >> >>
    >> >> >> >> This is known as "short-circuit" evaluation...but it requires *both* operands to be
    >> >> >> >> true.
    >> >> >> >> In your code, that is not alsways the case.
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >> >> Juan T. Llibre, asp.net MVP
    >> >> >> >> asp.net faq : http://asp.net.do/faq/
    >> >> >> >> foros de asp.net, en español : http://asp.net.do/foros/
    >> >> >> >> ======================================
    >> >> >> >> <> wrote in message
    >> >> >> >> news:...
    >> >> >> >> > It says invalid expression term &&
    >> >> >> >> >
    >> >> >> >> > protected void GridView1_RowDataBound(object sender,
    >> >> >> >> > GridViewRowEventArgs e)
    >> >> >> >> > {
    >> >> >> >> >
    >> >> >> >> > if
    >> >> >> >> > ((Convert.ToInt32(e.Row.Cells[2].Text)>=15))&&(Convert.ToInt32(e.Row.Cells[2].Text)>=17);
    >> >> >> >> > {
    >> >> >> >> >
    >> >> >> >> > e.Row.Cells[0].CssClass = "sdgStatusOrange";
    >> >> >> >> >
    >> >> >> >> > }
    >> >> >> >> >
    >> >> >> >> > It says invalid expression term &&
    >> >> >> >> >
    >> >> >> >>
    >> >> >> >>
    >> >> >> >>
    >> >> >>
    >> >> >>
    >> >> >>
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>
    Juan T. Llibre, Jun 22, 2007
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KK
    Replies:
    2
    Views:
    552
    Big Brian
    Oct 14, 2003
  2. Andrej Hocevar
    Replies:
    1
    Views:
    480
    Nick Austin
    Aug 18, 2003
  3. Replies:
    0
    Views:
    284
  4. tyler_durden
    Replies:
    7
    Views:
    349
    Nick Keighley
    Jan 3, 2005
  5. HP
    Replies:
    14
    Views:
    437
Loading...

Share This Page