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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:17:59+00:00 2026-05-27T07:17:59+00:00

I have a combo box that, when selected, displays text in 3 text boxes.

  • 0

I have a combo box that, when selected, displays text in 3 text boxes.

The combo box items are the 50 states, and the text boxes display information on state statutes. Right now I’m using a multidimensional array to hold the data for each state (each item in the array holds the state, item 1, item 2, item 3).

My question is: Would it be better or more compact to create a State data type that holds the 3 items, and actually if this is even an effective approach? I don’t like the array, it’s just all I know how to do right now.

For the most part, the 3 data types are used repeatedly.

For example, one of them is the time zone the state uses, so there are only 6 possible options.

I don’t have the code in front of me or I would post it, just something I was thinking about.

  • 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-27T07:18:00+00:00Added an answer on May 27, 2026 at 7:18 am

    The question you have to ask yourself about a multidimensional array is, “Can another programmer look at it and understand what is going on?”

    Is is more compact? Maybe mayby not. It all depends on the code. In truth, unless you are dealing with very low memory requirements, it probably doesn’t matter. Think of it this way, let’s say that each timezone takes up four bytes (size of an integer). Having entry for each timezone means you’ve used what 50 x 4 = 200 bytes. Not enough to worry about either way.

    I would change it, because in 6 months you probably are going to have difficulty understanding what it does. Readability and maintainability is king in almost all situations.

    so maybe an example is:

    class State
    {
        public State (string stateId, int timeZoneOffset)
        {
           StateId = stateId;
           TimeZoneOffSet = timeZoneOffset;
        }
    
        public String StateId {get;set;}
        public int TimeZoneOffest {get;set;}
    }
    
    public class StatesAndTerritories
    {
        List<State> _states = new List<State>
        public StatesAndTerritories ()
        {
          //_state.Add state information here
    
          _state.Add(new State("AZ", -6); ......
    
        }
    
        public IEnumerable<State> GetStates (){
         return _state;
        }
    
       public IEnumerable<State> GetStatesInZimeZone(int timezone)
        {}
    
        etc..
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function that presents the user a combo-box. def select_interface(interfaces) list_box :items
I have one combo box which displays a text box when 2nd or 3rd
I have a combo box that contains 5 items. I have one label on
The problem: I have a combo box that needs to fit into a fixed
I have a combo box in a C# Windows form application that is being
I have a combo box in which I set up an ItemTemplate that looks
I am trying to set up a combo box that will display a UserName,
I have a radajaxpanel that is populated with the selected item from a combobox
I have a ComboBox that I set up like this: this.cmbCustomerJob.DisplayMember = display; this.cmbCustomerJob.AutoCompleteMode
I have a combobox that passes along values in text, but they can have

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.