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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:49:03+00:00 2026-06-15T08:49:03+00:00

I am building a Data Access Layer which is going to be used in

  • 0

I am building a Data Access Layer which is going to be used in two types of applications.

  1. Applications that do not care about the specifics of the error. If an exception occurs then most probably is going to just get logged and the user may not be aware of it.

    Example: Simple barcode stock taking application. The user inputs the barcode and if a connection is available to the database, then the system provides some extra info, if not then only the barcode is recorded locally. In this case I do not want detail exception handling.

  2. Applications where I care a lot about the details of the exception.

What strategy do I have to follow when building my DAL in order to accommodate both categories?

Right now I am building an application from the first category and all I have done in my DAL methods is to just let the exception bubble up to the presentation layer, where I have several try..catch blocks in order to make the simple handling of logging, letting the user be unaware of he error.

  • 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-15T08:49:05+00:00Added an answer on June 15, 2026 at 8:49 am

    Error handling is geting information from the part of code that knows to the person who needs to know. The DAL knows how to pritty print the trace of, say, a SqlException, SqlCommand and the SqlParameters collection. But the UI knows the entire call stack that caused the exception. The user probably doesn’t know what to do with the information, so you should log to a separate channel, such as email to the developer or a log in the database.

    I would also recommend using a real application (or several real applications) as tests of your library if you are writting an error logger. For example, you could wire up your error logger to a variety of apps on codeplex and see what the pain points are in troubleshooting bugs, or try dogfooding and using your error logger to log errors is your own library.

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

Sidebar

Related Questions

I'd like ask a question about building applications in .NET that use data from
Do you know of any resources that describe building a data access layer using
I created a simple Caching Data Access Layer that has caching using the Enterprise
Can anyone suggest a simple Data Access Layer (C# .NET)? Not keen on using
Let's say I'm building a data access layer for an application. Typically I have
I am about to start building an app that will be used across all
I am building a data structure that helps indexing a collection of S documents
I am building a website to capture data. I have many spreadsheets that are
I am building a new web applications with data stored in the database. as
I'm building a tree-based data structure and overloaded [ ] so that I can

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.