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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:13:11+00:00 2026-05-26T07:13:11+00:00

I am getting information from an array and displaying the results in a text

  • 0

I am getting information from an array and displaying the results in a text box on the form. The value doesn’t get displayed in the UI, but it says that it has the value assigned.

try
{
    foreach (string r in Rows)
    {
        string[] h = new string[5];
        h = r.Split(',');
        MessageBox.Show(h[0]);
        // need to show the first record
        House newhouse = new House();

        newhouse.ID = Convert.ToInt32(h[0]);
        newhouse.Address = Convert.ToString(h[1]);
        newhouse.Type = Convert.ToChar(h[2]);
        newhouse.Cost = Convert.ToInt32(h[3]);
        newhouse.Sold = Convert.ToString(h[4]);

        loadedHouses.Add(newhouse);

        ID_Number.Text = Convert.ToString(h[0]);
        address1.Text = Convert.ToString("g");
        type1.Text = Convert.ToString(h[2]);
        cost1.Text = Convert.ToString(h[3]);
        sold1.Text = Convert.ToString(h[4]);
        MessageBox.Show("dewdwedw");
    }
}
catch (Exception qq)
{
    Console.WriteLine("{0} Exception caught.", qq);
}

When you hover over ID_Number while debugging, it says the value should be 1 but it doesn’t show up in the form. Can anyone help?

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

    Try this…

        private void button1_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < 100000; i++)
            {
                textBox1.Text = i.ToString();
            }
        }
    

    One can guess whats happening here. The numbers in the textboxes will DISPLAY text from 0 to 999. Right? Wrong…the out put will be just 999 in the end of loop.

    I am not an expert and i am trying to learn C#. But I know this code will work the way I am saying. Possibly you will have to do it in a separate thread. Try this…

        private void button1_Click(object sender, EventArgs e)
        {
            Thread t = new Thread(new ThreadStart(loop));
            t.Start();
        }
    
        private void loop()
        {
            for (int i = 0; i < 100000; i++)
            {
                textBox1.Text = i.ToString();
            }
        }
    

    This code should work as you are expecting.

    In the first case also textbox is getting the values continuously from the loop, but not able to display it as the Main thread is already busy. But in second case the thread is separate from the Main thread.

    I am not sure it is your problem, but to me it seems so. You are assigning the text to textboxes continuously in a loop. So even though the textboxes have the values but are NOT ABLE TO DISPLAY. If you try creating a new thread, now also textboxes will have the values but will be visible in the textboxes now. Its a kind of pseudo code, just to explain my point. If you are looking for the same, its ok. otherwise throw a stone at my head.

    Hope it helps.

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

Sidebar

Related Questions

I am getting a large text file of updated information from a customer that
I'm getting information from the database (MongoDB) and then converting it to an array
I'm getting information from database, saving it in array and echoing it in a
my mysqli_fetch_array(mysqi_query($db, $query)) doesn't appear to be getting the correct information from the database,
Here's the problem: In C# I'm getting information from a legacy ACCESS database. .NET
I have an iPhone application which basically is getting information from an API (in
I'm having trouble getting any information to display from this query. Anyone know where
i am getting some information from .net webserver and save them in NSuserdefaults. for
having a little problem getting the information from my spinner, this is how i
I've got an problem with getting information back from a memory block allocated by

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.