Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 556749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:57:10+00:00 2026-05-13T11:57:10+00:00

I have been working with a Linq query in a Silverlight application which returns

  • 0

I have been working with a Linq query in a Silverlight application which returns only the row of a table which contains the max value of the field OptionARMRunId (identity). When executed in LinqPad, the query runs fine and returns the correct row. However, when used in my Silverlight application, the application never moves past the loading screen (while the status percentage goes to 100%, the blue circle continues to go around ad nauseam) and I receive an error in the browser. I have included the original Linq statement, the statement as it appears in my query, and the ie error below.

Linq statement (works correctly):

    from OptionARMProjection in OptionARMProjections.Where(row => row.OptionARMRunId == OptionARMProjections.Max(r => r.OptionARMRunId))
select OptionARMProjection

Linq statement in C# class (causes error when silverlight application is run):

    crocodileEntities proxy = new crocodileEntities(new Uri("CrocodileDbDataService.svc", UriKind.Relative));



    var ProjectionsQuery = from OptionARMProjections in proxy.OptionARMProjections.Where(row => row.OptionARMRunId == proxy.OptionARMProjections.Max(r => r.OptionARMRunId))
                            select OptionARMProjections;

Error received in ie8:

Webpage error details

User Agent: Mozilla/4.0 (compatible;
MSIE 8.0; Windows NT 6.1; Trident/4.0;
SLCC2; .NET CLR 2.0.50727; .NET CLR
3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; Zune 4.0;
OfficeLiveConnector.1.4;
OfficeLivePatch.1.3; .NET4.0C;
.NET4.0E) Timestamp: Wed, 20 Jan 2010
03:06:13 UTC

Message: Unhandled Error in
Silverlight 2 Application The method
‘Max’ is not supported. at
System.Data.Services.Client.ResourceBinder.VisitMethodCall(MethodCallExpression
mce) at
System.Data.Services.Client.ExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.DataServiceExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.ExpressionVisitor.VisitBinary(BinaryExpression
b) at
System.Data.Services.Client.ResourceBinder.VisitBinary(BinaryExpression
b) at
System.Data.Services.Client.ExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.DataServiceExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.ExpressionVisitor.VisitLambda(LambdaExpression
lambda) at
System.Data.Services.Client.ExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.DataServiceExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.ExpressionVisitor.VisitUnary(UnaryExpression
u) at
System.Data.Services.Client.ExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.DataServiceExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.ExpressionVisitor.VisitExpressionList(ReadOnlyCollection1
original) at
System.Data.Services.Client.ExpressionVisitor.VisitMethodCall(MethodCallExpression
m) at
System.Data.Services.Client.ResourceBinder.VisitMethodCall(MethodCallExpression
mce) at
System.Data.Services.Client.ExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.DataServiceExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.ResourceBinder.AnalyzeProjection(MethodCallExpression
mce, Boolean matchMembers, Expression&
e) at
System.Data.Services.Client.ResourceBinder.VisitMethodCall(MethodCallExpression
mce) at
System.Data.Services.Client.ExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.DataServiceExpressionVisitor.Visit(Expression
exp) at
System.Data.Services.Client.ResourceBinder.Bind(Expression
e) at
System.Data.Services.Client.DataServiceQueryProvider.Translate(Expression
e) at
System.Data.Services.Client.DataServiceQuery
1.get_QueryComponents()
at
System.Data.Services.Client.DataServiceRequest.CreateResult(Object
source, DataServiceContext context,
AsyncCallback callback, Object state)
at
System.Data.Services.Client.DataServiceQuery`1.BeginExecute(AsyncCallback
callback, Object state) at
OptionARMChart.OptionARMUniverse.GetOptionArmProjectionsASync()
at OptionARMChart.MainPage..ctor()
at
OptionARMChart.App.Application_Startup(Object
sender, StartupEventArgs e) at
MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32
typeIndex, Delegate handlerDelegate,
Object sender, Object args) at
MS.Internal.JoltHelper.FireEvent(IntPtr
unmanagedObj, IntPtr unmanagedObjArgs,
Int32 argsTypeIndex, String eventName)
Line: 1 Char: 1 Code: 0 URI:
http://localhost:5004/optionarmcharttestpage.aspx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:57:10+00:00Added an answer on May 13, 2026 at 11:57 am

    .Max() isn’t supported, a workaround would be to do an reverse order and take the first:

    var ProjectionsQuery = proxy.OptionARMProjections
                           .Where(row => row.OptionARMRunId == proxy.OptionARMProjections
                           .OrderByDescending(r => r.OptionARMRunId))
                           .Take(1);
    

    Correction: Seems it is supported in Silverlight 3+, but it’s given me the same trouble more than once, so maybe someone can add some more details as to why.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would a LINQ for java be a useful tool? I have been working on
I have been working with relational databases for sometime, but it only recently occurred
I have been working on a web services related project for about the last
I have been working with Visual Studio (WinForm and ASP.NET applications using mostly C#)
I have been working with a string[] array in C# that gets returned from
We have been working with CVS for years, and frequently find it useful to
I have been working on some legacy C++ code that uses variable length structures
I have been working as a native C++ programmer for last few years. Now
I have been working with Struts for some time, but for a project I
I have been working on a childish little program: there are a bunch of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.