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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:48:41+00:00 2026-05-16T10:48:41+00:00

I have a simple LINQ query that is going against a collection. Dim oList

  • 0

I have a simple LINQ query that is going against a collection.

   Dim oList = From w In Os
                Order By w.ClassTitle Descending
        Select w

What I’d like to be able to do though is pass into this whether it’s descending or ascending. I’m not sure how to do that.

Also, if I were to have a where clause in here.. say

where w.ClassTitle = "Test"

How can I make the “Test so that I can pass it into the LINQ query.

Thanks
shannon

  • 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-16T10:48:42+00:00Added an answer on May 16, 2026 at 10:48 am

    I dont think you can pass that “into” this query, however you could do the regular query

    var oList = from w in Os
                select w
    

    Then when the user takes some action you could simply do an order by after that fact.

    oList.OrderBy(o => o.ClassTitle)
    

    or

    oList.OrderByDescending(o => o.ClassTitle)
    

    UPDATE:

    As far as the late binding, what you could do is write a method that would execute the Where clause. Perhaps using an extension method might work. I’m more familiar with C# so my syntax might be a bit off

    public static IEnumerable<Os> ExecuteWhere (this Table<Os> table, Expression<Func<Os, bool>> predicate)
    {
        return table.AsQueryable<Os>().Where(predicate);
    }
    

    Then to call it like so:

    oList.ExecuteWhere(a => a.ClassTitle == "Test")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple linq query that gets data from two datatables (orderHeader
I have a very simple table and I can happily query it using LINQ
I am learning LINQ and have a very simple question that I think will
I have a created a single LINQ query that creates a main group and
I have simple regex \.*\ for me its says select everything between and ,
Should simple JavaBeans that have only simple getters and setters be unit tested?? What
I have a simple webform that will allow unauthenticated users to input their information,
I have a simple 2-column layout with a footer that clears both the right
I have a method that sets up my linq data context. Before it returns
A simple linq to SQL query Might return a product object. Obiously I could

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.