locked
ObjectDataSource XXXXXXXX could not find a non-generic method xxxxx that has no parameters. RRS feed

  • Question

  • User1046032665 posted

    I have this really strange error...

    Strange in the fact that my website is working until I add linq to the BLL (where the Object datasource is connected to), then I get the following error:

    ObjectDataSource XXXXXXXX could not find a non-generic method xxxxx  that has no parameters.

    Strange thing is that the non-generic method is there and has no parameters.  I know it is working becuase without the following line, everything works.

     return context.getListOfAttachmentsByFilter(filter1, filter2, filter3,  filter4)
                         .Where(f => attachments.Contains(f.attachmentID));

    if I remove the Where statement, it's fine but with the Where statement it falls over.  This code is not in the method which is listed in the error.

    I think it could be a bug.

    Any suggestions or ways to investigate further?

    Friday, January 18, 2013 4:49 AM

All replies

  • User3866881 posted

    Hi,

    Can you show us:

    1)Your bound function's defination to ObjectDataSource?

    2) Your aspx codes?

    Saturday, January 19, 2013 8:49 PM
  • User1046032665 posted

    Thanks Decker.

    I ended up moving the LINQ to the DAL, which then worked but I am now getting the same again and would really like to know what is causing it.

    The application is structured as follows:

    FRONT END ---- BLL ---- DLL

    If I add a function in the BLL which uses Linq (below is an example) it will cause the above error (in fact all Object Data Sources fail in this way).  it seems that the functions in the BLL seem to disapear

    Removing the LINQ statement and the whole application works again.

    LINQ statement being added:

                using (allRepositry context = new allRepositry())
                {
                    return context
                        .getRawClients()
                        .Where(f => f.clientID == clientID)
                        .SelectMany(o => o.assignments)
                        .SelectMany(o2 => o2.visits)
                        .Where(f2 => f2.invoiceSent == false)
                        .Select(o3 => new dropdownClass
                        {
                            id = o3.visitID,
                            text = o3.vendor
                        })
                        .ToList();
                }

    To me, it seems the BLL is becoming corrupted or perhaps there is a bug in the LINQ library or maybe running out of memory.

    I'm a bit stumped

    Any suggestions?

    Thursday, January 31, 2013 6:19 AM
  • User1046032665 posted

    I have figured out, if I change the line

    .Where(f => f.clientID == clientID)

    to

    .Where(f => f.clientID == 1)

    it works.  It seems, using a variable within the LINQ causes an error.

    Thursday, January 31, 2013 9:09 AM