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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:32:45+00:00 2026-05-23T05:32:45+00:00

I am working on an import assistant (C# .NET 4) between 2 MS Access

  • 0

I am working on an import assistant (C# .NET 4) between 2 MS Access databases and I need to implement a mechanism to ensure data consistency.

Example:

Import persons.

Problem:

The columns from the person tables have different column sizes.

Source Table: Address column size = 50;

Destination Table: Address column size = 30;

When we try to import a person with a Address larger than 30 chars a problem appears.

Desired solution:

When the previous problem appears a dialog needs to be shown where the user can redefine or truncate the value to correspond to the require length.

Import function looks something like this

private static void ImportPerson()
{
    var sourcePerson = sourcePerson.GetObject();
    if (sourcePerson == null)
        return;

    var person = new MyPerson();
    person.Address.Value = sourcePerson.Address;    
    person.Company.Value = sourcePerson.Company;
    person.Save();  
}

I have metadata information stored in my objects witch allows me to access the column size of my destination columns.

person.Address.ColumnSize

So I can do something like this after filling business objects with the new values.

if (person.Address.ColumnSize.CompareTo(person.Address.Value.Length)) < 0
    // show dialog ...

Unfortunately this means checking all the properties (Address, Company… and other) individually.

I am looking for a more generic approach where I don’t need to check every property individually.

Any ideas, suggestions, thoughts would be highly appreciated.

  • 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-23T05:32:46+00:00Added an answer on May 23, 2026 at 5:32 am

    Presumably, the members of your class (Adress, Company, etc) are all objects of the same type, since they seem to have consistent properties that you’re using for metadata. Add a method to your MyPerson class to provide access to its properties by iterating, e.g.

    class MyPerson {
    
        public IEnumerable<MemberClass> Properties
        {
            get {
                yield return Adress;
                yield return Company;
                ...
            }
        }  
        ...
    }
    

    Then

    foreach (MemberClass prop in person.Properties) {
        if (prop.ColumnSize.CompareTo(prop.Value.Length) < 0)
           // show dialog ...
        }
    }
    

    It would probably also make sense to collect all the failures in a list and just show a single dialog for the record, to make life easier for the user.

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

Sidebar

Related Questions

I'm working on a project atm, and I need to import data that is
I'm actually working at MOSS 2007 project where I have to import data from
I need to import some ANSI C code into a project I'm working on.
I've been working on data import functions for a library recently and I found
I am working with SSIS and trying to import data from MySql to SQL
Working on some import process where i need to first upload the file at
I am working on an application that can import data from several different formats.
We're working on creating a Windows service to import/export data from various places. Our
I have a Graphics object of JPanel and that is working fine: import java.awt.Color;
I'm working on an import (from Excel) dialog to select ranges of cells. When

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.