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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:25:21+00:00 2026-06-18T00:25:21+00:00

I’m working on a Winforms C# application for a client which replaces their old

  • 0

I’m working on a Winforms C# application for a client which replaces their old MS Access based solution. It’s a complete rewrite and now uses SQL Server as its database. This software is now in the final stages of development.

One thing that they’ve just requested is that ability to do custom queries that the software’s UI may not currently let them do at the time they need it.

With their old Access solution, they could use the query designer to create their own custom queries. With the winforms/Sql Server solution they can’t do this. They don’t want to have to write SQL themselves either.

Can anyone think of a good solution to this problem? Perhaps a Winforms library which allows the user to create a graph of business objects and “and|or” logic. Or some other type of UI which allows them to customise queries, almost like they could do in Access (but perhaps more domain specific).

Update

I’ve flagged Yaqub’s answer as the answer, as this is the closest to what I was looking for at the time. I ended up though writing a custom form for them to generate their queries:

enter image description here

The “Select table …” combobox in the second group only shows tables that have been added to the top listbox.

Because the database layout is pretty much set in stone now, I’ve written code to intelligently calculate any joins required. For example, if they add two indirectly related tables in the top group, then when it generates the SQL, it’ll add any required joins to relate those. If the database layout does change, I’ve made it very easy to change FK references in the query editor’s code.

For the condition group, the value control (4th control down in that group) changes depending on the field type (textbox, numerical up/down control, datepicker, checkbox).

When they click on “Run query”, they get another form with a gridview displaying the results. In that results form, they can export to a tab delimited file.

I’ve given them the first version of this, and they seem very happy with it so far.

I didn’t want to go the Access route because the whole point of this new version of the software is moving them away from Access (well, not the whole point, as there’s a lot more functionality in there too). It seemed a huge step back to keep that dependency with Access there. It also means that if they save lots of custom queries in Access, and I ever change the database schema, I’ll most likely break their queries. I don’t want them having access to the database like that. In my mind, it’s asking for trouble. The only thing that should be touching the database is the new software, and any automated database backups we do – nothing else, especially not users!

Another advantage to doing it within the software, is that I can do post processing on the query results. For example, there are quite a few data analysis algorithms that are run in the software which are written in the .NET code. So I can add fields to this interface that allow them to select the results of these algorithms.

  • 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-18T00:25:22+00:00Added an answer on June 18, 2026 at 12:25 am

    You may find the Visual SQL Query Designer helpful. It will give you an idea that how you can implement this functionality.

    This tool can be used to design SQL queries. Its UI is very basic as compared to SQL Server Management Studio. Its limitation is that it uses OLEDB connection string. You can download the source code from here.

    EDIT:

    EasyQuery.NET WinForms can be an option but its not free.

    This article may also help you a bit.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
this is what i have right now Drawing an RSS feed into the php,
I have a small JavaScript validation script that validates inputs based on Regex. I
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an autohotkey script which looks up a word in a bilingual dictionary
I'm trying to select an H1 element which is the second-child in its group

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.