none
JScript RRS feed

  • Question

  • Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Operator '==' incompatible with operand types 'Int32?' and 'Object'

    I keep getting the above error at random times, I am using linq to sql queries and binding the results to a grid view. Using the auto select button sometimes works (I don’t use linqdatasource and on this select button I have attached my own script so it usually works fine) when selecting a record I will make a call to the database and return a record, however when I get to this point in debugging the code:

    public System.Data.Linq.Table<Asset> Assets

    {

    get

    {

    return this.GetTable<Asset>();

    }

    }

    when I move from this point the error above appears. I had received some advice based on where clauses returning nulls, however I decided to populate my whole database and there are no null values and I still get the same error but only at random times. It is so random that one minute selecting a record will not work, however if I refresh the page and click on the same record it will work!

    However:

    I do have two grid views that have linqdatasources assigned to them and when I add this code below, every time I click on the edit button I receive the same error above:

    <asp:CommandField ButtonType="Image" EditImageUrl="~/img/Edit.png" CausesValidation="false"

                              ShowEditButton="true" UpdateImageUrl="~/img/UpdateGrid.png" CancelImageUrl="~/img/CancelGrid.png" />

    But when I just use:

    AutoGenerateEditButton="true"

    it works perfectly fine and I can edit the row.

    Please can anyone help, this being so random is doing my head in.

    Thanks James


    J S S
    Friday, July 17, 2009 10:15 AM

Answers

  • I think i have fixed it, my linq queries where still returning nulls, bigger data problem I think, sorry for wasting anyones time.

    Thanks Jamed


    J S S
    Monday, August 3, 2009 2:08 PM