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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:10:16+00:00 2026-05-20T15:10:16+00:00

If you have a customer class with 85 properties and you assign each property

  • 0

If you have a customer class with 85 properties and you assign each property with a valu for 5000 customers, then add each customer to a list so you can show each costomer in a datagridview. How long should this process take from when pressing down a button and assigning the first customer until all the 5000 customers has been assigned a value and shown in the gridview?

I want to know how many minutes doese it to assign 85 properties for 5000 customers, then add the customers to a list and shows them in a gridview.

EDIT: Here is some code:

    private string customerID;
    public string CustomerID
    {
        get { return customerID; }
        set { customerID= value; }
    }
    private int username;
    public int UserName
    {
        get { return username; }
        set { username= value; }
    }
    private string adress;
    public string Adress
    {
        get { return adress; }
        set { adress= value; }
    }

In another class i use while and switch-statement to assign these values. In the while-statement, as long as there is customers i use a switch-statement like this:

               switch (customers)
                {
                    case "Customer ID":
                        try
                        {
                            cust.CustomerID = customerid;
                        }
                        catch
                        {
                        }
                        break;
                    case "User Name":
                        try
                        {
                            cust.UserName = username;
                        }
                        catch
                        {
                        }
                        break;
                    case "Adress":
                        try
                        {
                            cust.Adress = adress;
                        }
                        catch ()
                        {

                        }
                        break;

I assign the customer properties like this.

  • 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-20T15:10:16+00:00Added an answer on May 20, 2026 at 3:10 pm

    The real answer to your question: it depends.

    I’d oppose the design of such a system, use lazy loading and paging instead. But suppose you’d do it, we can make a little calculation (change the numbers to your actual values):

    Memory considerations

    • 85 properties have to be assigned, let’s say with 16 bytes, than this makes 1360 bytes
    • A list contains pointers to each item, this makes 1360 + 4 (or 1360 + 8) = 1364 bytes
    • 5000 * 1364 = 6820000
    • Display in a DataGridView: overhead per row about 4000 bytes (you have to test this for yourself, part of it may be stored depending on scrolling): 27280000000 =
    • That is 26GB

    Now, I have a system with 64GB inside, 64 bits. It might take as little as a few seconds (assuming I won’t scroll). Filling the 5000 rows can be less than a few milliseconds though, even on an average system (5000 records is not much).

    Any system that doesn’t have enough memory available will start paging (swapping to the physical page file). This becomes very slow, orders of magnitude. Remember that when playing with relatively large datasets.

    Note: I assumed everything was random and you tried measuring the speed of the object itself. But if your data comes from a disk, a remote database or worse, a web service, this can take any time from seconds to hours.

    Active directory

    EDIT: in a late comment under Darin’s answer, you talk about Active Directory. This is remote and your speed will likely depend more on AD than anything else. Add paging (i.e., only load what you want to show) and you should get reasonable performance.

    Your code

    You show a bit of your code. The try/catch around the settors: they don’t do anything, there’s nothing to catch. In terms of performance: you just showed the part that’s not performance critical (unless any of those strings are huge, see my memory section above). The part that is slow, is your AD part.

    Conclusion (so far)

    Reconsider your design. Read the data in chunks of 10 or 20 records, and only request those fields / properties from AD that are actually needed to show. You can’t show them all at once anyway. DataGridView has excellent features for paging, I suggest you use the paging events in combination with better loading of the data.

    In answer to your remark about it suddenly taking much more time above 5000 records: measure the performance counters of each system, check memory, page faults, network. Or just don’t read above 5000 records at once.

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

Sidebar

Related Questions

Say I have a class Customer which has a property FirstName . Then I
I have a Customer class that contains a property, MyProperty, which is of a
I have this scenario: One custom class (Customer) with some properties, like this: public
I have a customer class which has both PhoneNumber and Email properties. Using DataAnnotations
Say I have a Customer class with the usual properties: CustomerID , Name ,
Let's say I have a class Customer, which has a property customerType. I have
I have a class Customer (with typical customer properties) and I need to pass
If I have a Customer class that just has simple properties (e.g. Name ,
Suppose, I have a Customer class with some properties like name, id, object of
I have an object Customer that can have multiple customer types and each customer

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.