none
Generic Error for lambda expression RRS feed

  • Question

  • Hello,

    I am getting generic exception for my lambda expression. can anyone suggest me the option to troubleshoot this?

    Error:

    An exception of type 'System.Data.Services.Client.DataServiceQueryException' occurred in Microsoft.Data.Services.Client.dll but was not handled in user code

    InnerException: Null

    Expression:

    result= context.MyRequests.Expand("MyRecords").Where(r => r.DateModified > DateTime.Now.AddDays(-30)).ToList();

    Note: 1. Records exists in SQL table for this query.

    2. I have already set this property.

    context.IgnoreResourceNotFoundException = true;

    3. The query takes more than 2 minutes to execute in SSMS

    Thursday, November 23, 2017 7:18 AM

All replies

  • Hi Kodnil,

    Since the code is not completed, from the lambda expression, I am not sure what cause the issue, from the following document, the exception that indicates an error occurred loading the property value from the data service instead of a lambda expression exception.

    Could you please share a simple demo via OneDrive (Please remove related privacy information), which could reproduce the issue.

    https://msdn.microsoft.com/en-us/library/system.data.services.client.dataservicequeryexception%28v=vs.110%29.aspx?f=255&MSPPError=-2147217396

    Best regards,

    Zhanglong Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 24, 2017 6:03 AM
    Moderator
  • Hello,

    I am getting generic exception for my lambda expression. can anyone suggest me the option to troubleshoot this?

    Error:

    An exception of type 'System.Data.Services.Client.DataServiceQueryException' occurred in Microsoft.Data.Services.Client.dll but was not handled in user code

    InnerException: Null

    Expression:

    result= context.MyRequests.Expand("MyRecords").Where(r => r.DateModified > DateTime.Now.AddDays(-30)).ToList();

    Note: 1. Records exists in SQL table for this query.

    2. I have already set this property.

    context.IgnoreResourceNotFoundException = true;

    3. The query takes more than 2 minutes to execute in SSMS

    Can someone help me with equivalent sql query of the same?
    Friday, November 24, 2017 8:20 AM
  • Can someone help me with equivalent sql query of the same?

    If you're talking about T-SQL, then post to the T-SQL forum.

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?category=sqlserver

    Friday, November 24, 2017 10:01 PM