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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:59:04+00:00 2026-06-04T12:59:04+00:00

I have this in my method: var qry = db.Forms.Take(4) .Where(m => m.SateliteID ==

  • 0

I have this in my method:

var qry = db.Forms.Take(4)
                  .Where(m => m.SateliteID == Id)
                  .OrderByDescending(m => m.Tanggal)
                  .ToArray();

What I want is getting the last 4 records from all the records available, but
what I get is the first 4 records.
What I have done wrong?
I thought that command will be the same with this:

SELECT TOP 4 <fields> FROM Forms WHERE sateliteID = Id
ORDER BY tanggal DESC

But it seems they are a different.
What should I do to get what I want (the last 4 records instead of the first 4 records)?
Thanks in advance for the help.

  • 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-04T12:59:06+00:00Added an answer on June 4, 2026 at 12:59 pm

    Move your Take:

    var qry = db.Forms.Where(m => m.SateliteID == Id)
                     .OrderByDescending(m => m.Tanggal)
                     .Take(4)
                     .ToArray();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this method: public CampaignCreative GetCampaignCreativeById(int id) { using (var db = GetContext())
I have this code working in C#: var request = (HttpWebRequest)WebRequest.Create(https://x.com/service); request.Method = GET;
i have this method: set_period_help_text: function(periodInput){ var metric = MonitorMetric.getSelectedMetric(); var periodStr = $('select[name=metric_period]').val();
i have this method: public IEnumerable<Album> GetAllAlbumsWithTracks() { var albums = Session.CreateCriteria(typeof(Album)) .SetFetchMode(Tracks, FetchMode.Eager)
I have this method: private static void StartLicensePlateMonitor(Autofac.IContainer container) { var monitor = container.Resolve<LicensePlate.LicensePlateUploadMonitor>();
I have this method: public virtual IEnumerable<Invoice> GetHomePageInvoices(IList<Area> areas, FinancialYearLookup financialYear) { var homePageInvoices
Hello i have this method: private function findConnectedNodes(node:Node):Array{ var test_node:Node; var surrounding_nodes:Array = [];
I have this method and want to get all properties from the FieldInfos? How
I have this method public static List<SummaryItinerary> ReturnBookingsByUserGuid(Guid userGuid) { var entities = new
I have this method: function replaceRightClickIcefacesMethod() { var oldName = jQuery(.singlePaneOfGlassBlock).attr(oncontextmenu); oldName = oldName.replace('Ice.Menu.contextMenuPopup',

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.