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

  • SEARCH
  • Home
  • 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

Ask A Question

Stats

  • Questions 297k
  • Answers 297k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer So the answer is: Don't do this. Instead you can… May 13, 2026 at 7:25 pm
  • Editorial Team
    Editorial Team added an answer -[NSString writeToFile...] does not create a plist. It creates a… May 13, 2026 at 7:25 pm
  • Editorial Team
    Editorial Team added an answer System.Drawing is a part of WinForms NOT WPF First I… May 13, 2026 at 7:25 pm

Related Questions

I have a number of different data sources that I need to query and
Let me start off by saying that I am very new to WPF and
My question is essentially a simple one, though I'm looking for as in-depth an
This is my first crack at a method that is run periodically during the
I know there have been numerous questions here about inline sql vs stored procedures...

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.