Cannot perform '=' operation on System.String and System.Int32

Last post 05-09-2009 1:11 AM by shahid13384. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 05-08-2009 5:01 AM

    • shahid13384
    • Top 50 Contributor
    • Joined on 06-09-2008
    • United States of Mehsana
    • Wannabe Slacker
    • Points 563

    Cannot perform '=' operation on System.String and System.Int32

    HI all my code is this

     dr["AcademicYear"] = ddlAcademic.SelectedItem.Text.ToString();

    where datatype of : AcademicYear=varchar(50);

                                   ddlAcademic.SelectedItem.Text.ToString(); ="2008-09"

              and m getting following exception

    Cannot perform '=' operation on System.String and System.Int32

     

    Thanks & Regards


    The trouble with the world is that the stupid are sure and the intelligent are full of doubt.

    Shahid Hussain Shaikh
    Filed under: , ,
  •  Advertisement

    Featured Advertisement

     
  • 05-08-2009 7:27 AM In reply to

    • xxxd
    • Top 10 Contributor
    • Joined on 12-18-2006
    • Slacker
    • Points 19,057

    Re: Cannot perform '=' operation on System.String and System.Int32

     can you double check your field type? And what are you trying to do here?

     

  • 05-09-2009 1:11 AM In reply to

    • shahid13384
    • Top 50 Contributor
    • Joined on 06-09-2008
    • United States of Mehsana
    • Wannabe Slacker
    • Points 563

    Re: Cannot perform '=' operation on System.String and System.Int32

    Ya i have Octa check the field type.

    I am trying to update datarow of datatable which contain field "AcademicYear"

    interestingly same thing goes perfect in insert operation.

     

     

     

    Thanks & Regards


    The trouble with the world is that the stupid are sure and the intelligent are full of doubt.

    Shahid Hussain Shaikh
Page 1 of 1 (3 items)