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

  • Home
  • SEARCH
  • 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 3397712
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:33:41+00:00 2026-05-18T04:33:41+00:00

It’s a pretty standard setup, WinForms client > Self-serving Business/Data layer > SQL Server

  • 0

It’s a pretty standard setup, WinForms client > Self-serving Business/Data layer > SQL Server (stored procedures).

At the moment, my WinForms call to grab the data will be something like
MyData = RecipientInfo.GetListings(<options>). It will then fill the UI with said data, mostly through Binding as all the objects support things like BindingList and INotifyPropertyChanged.

The GetListings() function does two things. Firstly it gets a list of lookup data, then once that structure is filled from the DataReader, another function will go off and do more database access by calling another objects static GetOtherRelatedStuff(<stuffId>) method. This will then get sorted and grouped later on.

I suppose my question really is more of a matter of taste, but here are the obvious options if I want to process my SQL (DataReaders and the likes to populate my objects manually) and then do some basic analysis of data whilst the user is waiting.

  1. Make my initial data access mechanism use the IAsyncResult pattern, my WinForm will expect a callback
  2. Use the SqlCommands BeginExecuteReader() function and callback when ready. This won’t help my calling code so I’ll have to hook up a double callback routine to inform the WinForms client about when the job is done
  3. Events? Probably not.
  4. BackgroundWorker? This is good and I’ve used this with great success before, but it does feel a bit UI centric (which is really the point of this excersise).
  5. Use Tasks from Parallel extensions within my WinForms calling code. I’m guessing that my actual data layer code for SQL work will be written synchronously as usual and the WinForm will just take care of running it and processing the UI when it’s complete.

In fact, I can also use helpers internally like AsParallel to assist with the extra data getting methods and data grouping/sorting after SQL work is done.

Tasks also make Unit Testing a lot easier as my data access code is written in a way that’s easy to execute.

Anything I’ve missed?

  • 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-18T04:33:42+00:00Added an answer on May 18, 2026 at 4:33 am

    Ok so this was quite a subjective question, but I’ve decided to go down the route of Tasks from the TPL, executed from my WinForms client.

    My “business layer” accepts a CancellationToken for long jobs of work and it’s broken down into many specific routines to help parallelise the multi-stage process.

    SQL is done synchronously, but run through Tasks it is self-threaded. Although I’m having to carefully consider the WinForms code to comply with the specific data requirements, it’s easily broken down, and ties the solution together nicely.

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

Sidebar

Related Questions

No related questions found

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.