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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T18:17:47+00:00 2026-05-11T18:17:47+00:00

I am struggling to get a subsonic select query to work, I am writing

  • 0

I am struggling to get a subsonic select query to work, I am writing a paging method and tried the following

Select ns = new Select(maincolumns.ToArray());
ns.PageSize = 10;   ** Error Here **
ns.PageIndex = 1;   ** And Error Here **
ns.Where("IsLive").IsEqualTo(true);
ns.And("Title").Like("%" + SearchTerm + "%");
ns.OrderAsc("RentalExVat");
return ns.ExecuteDataSet().Tables[0];

Now it doesn’t recognise ns.PageSize Or ns.PageIndex, the rest of the query works fine?? I see I need to use the new ‘Query’ tool to be able to use these two, but I can’t figure out the Query syntax??

any syntax help appreciated

  • 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-11T18:17:47+00:00Added an answer on May 11, 2026 at 6:17 pm

    SubSonic’s query syntax is ‘fluent’, so in your code sample, the Where clause is not be applied to your query. This snippet may work better:

    Select ns = new Select(maincolumns.ToArray());
    ns = ns.Where("IsLive").IsEqualTo(true)
           .And("Title").Like("%" + SearchTerm + "%")
           .OrderAsc("RentalExVat")
           .Paged(1, 10); // paging is set here
    return ns.ExecuteDataSet().Tables[0];
    

    Also, make sure your ‘SearchTerm’ has been SQL escaped (or use an alternate calling pattern) or you are vulnerable to SQL injection.

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

Sidebar

Related Questions

I'm struggling to get the following MySQL statement to work. SELECT ItemGroup.users_id,ItemGroup.comments_id,ItemGroup.uploads_id,ItemGroup.posts_id, Comment.id,Comment.uploads_id, CommentUpload.id,
Struggling to get this query working: $query_search = SELECT questionnaires_index.id, questionnaires_index.ea_num, questionnaires_index.address, questionnaires_index.status, questionnaires_index.json_stored
I´m currently struggling to get this to work. SELECT Y, SUM(N) AS sumDK, NULL
Im struggling to get a web method to work in VB. The javascript gets
Struggling to get any list function to work. I've been fine with _show and
I am struggling to get a couple of javascripts scripts to work properly. The
I'm struggling to get my head around how to do the following: I have
I have been struggling to get Boost.Python running . i am following the steps
Hello I'm struggling to get the query below right. What I want is to
I'm struggling to get passenger+rvm+apache+rails working. When opening the page, I get the following

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.