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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T14:42:59+00:00 2026-05-10T14:42:59+00:00

If I have a collection of database tables (in an Access file, for example)

  • 0

If I have a collection of database tables (in an Access file, for example) and need to validate each table in this collection against a rule set that has both common rules across all tables as well as individual rules specific to one or a subset of tables, can someone recommend a good design pattern to look into?

Specifically, I would like to avoid code similar to:

void Main() {     ValidateTable1();     ValidateTable2();     ValidateTable3(); }  private void ValidateTable1() {     //Table1 validation code goes here }  private void ValidateTable2() {     //Table2 validation code goes here }  private void ValidateTable3() {     //Table3 validation code goes here } 

Also, I’ve decided to use log4net to log all of the errors and warnings, so that each method can be declared void and doesn’t need to return anything. Is this a good idea or would it be better to create some sort of ValidationException that catches all exceptions and stores them in a List<ValidationException> before printing them all out at the end?

I did find this, which looks like it may work, but I’m hoping to actually find some code samples to work off of. Any suggestions? Has anyone done something similar in the past?

For some background, the program will be written in either C# or VB.NET and the tables will more than likely be stored in either Access or SQL Server CE.

  • 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. 2026-05-10T14:42:59+00:00Added an answer on May 10, 2026 at 2:42 pm

    Just an update on this: I decided to go with the Decorator pattern. That is, I have one ‘generic’ table class that implements an IValidateableTable interface (which contains validate() method). Then, I created several validation decorators (that also implement IValidateableTable) which I can wrap around each table that I’m trying to validate.

    So, the code ends up looking like this:

    IValidateableTable table1 = new GenericTable(myDataSet); table1 = new NonNullNonEmptyColumnValidator(table1, 'ColumnA'); table1 = new ColumnValueValidator(table1, 'ColumnB', 'ExpectedValue'); 

    Then, all I need to do is call table1.Validate() which unwinds through the decorators calling all of the needed validations. So far, it seems to work really well, though I am still open to suggestions.

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

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 76k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I would use Andomar's Period table idea, but I would… May 11, 2026 at 2:56 pm
  • added an answer By default, SharePoint has custom handling for access denied exceptions… May 11, 2026 at 2:56 pm
  • added an answer ASP.NET only looks for a code behind file if it… May 11, 2026 at 2:56 pm

Related Questions

I have a Task object that has a collection of Label objects ... in
I'm developing a WinForms application (.Net 3.5, no WPF) where I want to be
I have a scenario in a system which I've tried to simplify as best
I'm trying to get my head round this mind boggling stuff they call Database

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.