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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:45:21+00:00 2026-05-14T20:45:21+00:00

I pass a data access class (DAL) of my own making into a another

  • 0

I pass a data access class (DAL) of my own making into a another class so it can use those data access methods to store data in my sqlite database.

This is type-safe because each method that accesses the database creates it’s own connection object so calls to the connection object always come from the same thread it was created on.

I’d like to just use one connection (or a pool of connection objects) in my DAL class and this would work fine if all calls to my DAL came from the main UI thread.

Is there a way for my DAL class to use a connection object (or pool of them) when called from the main thread but then use a different connection object if is being called from a background thread?

  • 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-14T20:45:22+00:00Added an answer on May 14, 2026 at 8:45 pm

    You can call InvokeRequired on any WinForms Control-derived type to determine if you’re on the main thread or not. If InvokeRequired returns true, then you are not on the main UI thread.

    If you’re using WPF, you can call Dispatcher.CheckAccess on the DependencyObject.Dispatcher property of one of your UI elements. If CheckAccess returns true, it’s the main UI thread.

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

Sidebar

Related Questions

How to pass a class into another class to a codebehind? When I debug
I'm looking for secure ways to pass data between a client running Flash and
Which method would you recommend to pass data from a child view back to
What is the best way to pass data between a C server to a
What's the best way to pass data from one Windows Forms app (an office
At work we are being asked to create XML files to pass data to
I am using a cross page postback for Page A to pass data to
In previous releases there were 3 ways to pass data from controller to view
I have a user control in a repeater that I need to pass data
In a WinForms UserControl, I would pass data to the main GUI thread by

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.