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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:00:07+00:00 2026-05-20T18:00:07+00:00

I`d like to implement a feature, that will allow user to type something like

  • 0

I`d like to implement a feature, that will allow user to type something like this:

"select * from products where low(price);" 

what is equal to:

"select * from products where (price >=0) And (price <= 50);"

do you maybe know any solutions that will be useful for me ? My second question is where in the application structure should I transform it ? In the application code or somehow in the database ?

My app is written in C# and connects to SQL Server 2008 via ADO.NET.

I would be very greatful for any hints, pseudocode, etc.

Thanks in advance !

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

    SQL Server allows you to define user-defined functions (see for example this article). If you defined a function low then the first code you wrote would be a perfectly valid SQL query and you wouldn’t need to do any pre-processing at all. The declaration would look roughly like this:

     CREATE FUNCTION low(@price)
     RETURNS boolean AS
     BEGIN
       RETURN (@price >= 0) AND (@price <= 50)
     END
    

    If you want to allow more fuzzy language than just function calls, then that would be another (and significantly more complicated) problem. I’m not aware of any library that does that and implementing that yourself could be quite a challange. (You may want to add more examples, so that we can see what you mean).

    Of course, if you allow the user to write raw SQL queries, the user should be someone you can trust (because they can easily drop all data from your database).

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

Sidebar

Related Questions

I'd like to implement a simple class (in Java) that would allow me to
I'm trying to implement a feature similar to StackOverflow's tag feature. That a user
I'd like to implement a feature in my application where show a dialog to
Hi i've plan to implement a feature like session in window application but not
I have a need to implement a rating feature and would like to do
I am trying to implement a similar feature like the autosuggest feature for tags
I want to implement an ISAPI filter like feature using HttpModule in IIS7 running
I released an app and I've implemented a user-requested feature and would like to
I would like to implement something similar to a c# delegate method in PHP.
I would like to implement the following feature using jQuery scrollTo function or some

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.