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 8015877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:22:52+00:00 2026-06-04T20:22:52+00:00

I am creating a C# 2010 application using .NET Framework 3.5. I have a

  • 0

I am creating a C# 2010 application using .NET Framework 3.5.

I have a datagridview that contains a few columns and rows [obviously]. I save this datagridview’s rows in a structure of the form List<string[]>. I also have a List<double> which contains coefficients. I want to sort the structure by the coefficients using the System.LINQ library. I have attempted the following:

var linq_Query_rowrates =
    from rw in rows
    orderby matchrate descending
    select rw;

This underlines the rows in the query and shows the following error:

Error 1 Could not find an implementation of the query pattern for source type ‘System.Collections.Generic.List<string[]>‘. ‘OrderByDescending‘ not found. Are you missing a reference to ‘System.Core.dll‘ or a using directive for ‘System.Linq‘?

Is it possible to sort this kind of structure using the LINQ library and if yes, how?

Note: I am aware of a lot of other methods to accomplish this, I am just interested in doing it using the LINQ library.

Note: matchrate is not a member of rows but using a member of rows does not work either.

LATER EDIT: Maybe it should be something like this?

        var linq_Query_rowrates =
            from rw in rows
            join rate in matchrate
            on matchrate equals rows
            orderby matchrate descending
            select rw;
  • 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-06-04T20:22:54+00:00Added an answer on June 4, 2026 at 8:22 pm

    It’s ugly, but it’s Linq:

                List<string[]> rows = null;
                List<double> coefficients = null;
    
                rows
                    .Select((row, index) => new { Row = row, Index = index })
                    .Join(coefficients
                                .Select(
                                    (coefficient, index) => new { Coefficient = coefficient, Index = index }), 
                                    x => x.Index, 
                                    x => x.Index, 
                                    (rowIndex, coefIndex) => new { Row = rowIndex.Row, Coefficient = coefIndex.Coefficient })
                    .OrderBy(x => x.Coefficient)
                    .Select(x => x.Row);
    

    I haven’t tested it though. It should be possible to transform it to query form.

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

Sidebar

Related Questions

I have an ASP.NET MVC 3 application using an Entity Framework (4.3.1) Code First
I'm creating an application in C# using Visual Studio 2010/.NET 4.0. For part of
I have an ASP.NET MVC 3 application. I'm using AsyncController and creating new threads.
I have an asp.net web application (c#) in visual studio 2010 that is heavily
I have Visual Studio 2010. I learned that for creating event handlers we have
i am using firefox 3.63 with asp.net mvc2 in vs 2010.the thing is that
I am new in creating application using Visual Studio 2010 and Microsoft Access 2007.
While creating a Windows Form Application, I selected target to .Net Framework 4.0. Now
I have created an office shared add in using Visual Studio 2010 .NET 4.0.
I've created a setup project for a VB.NET 2010 application that I've written. The

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.