C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » .NET »

LINQ query syntax help


Posted Date: 04 Nov 2009      Posted By: urpalshu      Member Level: Gold     Points: 1   Responses: 0



Hello:

below is my linq query which works just fine,

now I want to be able to order by by sending in parameter values.
because i am trying to do sorting by Value.

Right now my query is sorting by the group value ItemGroupDesc

please could somebody help with syntax

we could add an expression this way right , my syntax is not quite right

var sortexpression = Expression.Lambda<Func<pTable.AsEnumerable(),object>>(Expression.Property(Param , "IM_CustomerItemNumber"), param);


MyAccordion.DataSource = pTable.AsEnumerable()
.GroupBy(r => r["ItemGroupDesc"], r => new
{
CustomerItemNumber = r["CustomerItemNumber"],
ItemNumber = r["ItemNumber"],
ItemDescription = r["ItemDescription"],

}, (k, enumerable) => new { Key = k, Values = enumerable }).OrderBy(g => g.Key);
MyAccordion.DataBind();



Thanks





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Post Reply
You must Sign In to post a response.
Next : Make dynamically created button public.
Previous : String Format for Currency
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use