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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:09:10+00:00 2026-05-13T12:09:10+00:00

In a WPF application I use LINQ to SQL queries inside try – catch

  • 0

In a WPF application I use LINQ to SQL queries inside try – catch constructions to process exceptions, in case there is something wrong with DB server connection.

The problem is – I have some queries executing on a timer-polling basis. So, if connection fails, I have numerous long queries attempts and UI is freezing.

What is the standard way out? I would like to have easy lightweighted way of constant checking if db connection is OK and then do all the stuff with all my queries.

  • 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-13T12:09:10+00:00Added an answer on May 13, 2026 at 12:09 pm

    run it in a backgroundworker thread, or a separate thread entirely.

    Work should not be done on the UI thread, unless it directly pertains to the UI itself. BackgroundWorker is an object that makes threading stuff like this really easy. For a tutorial see this entry. It explains what Background worker does and how to use it.

    If you do work on the UI thread, you are stealing CPU cycles away from the UI causing it to feel slow to the user. Running the work on it’s own thread and then updating the UI is the best way to do it. That way the user can do other stuff and the UI responds properly.

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

Sidebar

Related Questions

In a WPF application I use LINQ to SQL, SQL Server 2008. SQL Server
I am trying to adapt a simple WPF application to use the Model-View-ViewModel pattern.
I've been trying to use the WPF toolkit in a WPF application that I'm
I'm trying to use the FolderBrowserDialog from my WPF application - nothing fancy. I
I'm in the process of building my first real WPF application (i.e., the first
I'm writing a WPF client app, using Linq to Sql with Sql Compact edition.
Please help! Background info I have a WPF application which accesses a SQL Server
In my simple WPF application I use regular CheckBox control. It looks like I
Possible Duplicate: How can one host Flash content in a WPF application and use
I am trying to use MVVM in my WPF application which displays data from

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.