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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:46:49+00:00 2026-05-25T23:46:49+00:00

I an new in creating programs in Visual Studio C#. I want to create

  • 0

I an new in creating programs in Visual Studio C#. I want to create a program that reads the information from MySQL and display the selected information in a textbox. What I have here is a code for displaying the information in a combobox.

This is the code to display information from MySQL in a combobox:

private void comboBoxDistrict_SelectedIndexChanged(object sender, EventArgs e)
    {
        comboBoxDistrictName.Items.Clear();
        string query = "SELECT employee_lastname, employee_firstname, employee_middlename FROM employee WHERE employee_district = '" + comboBoxDistrict.Text.ToString() + "'";
        DBConn db = new DBConn();
        DataTable tbl = db.retrieveRecord(query);
        foreach (DataRow row in tbl.Rows)
        comboBoxDistrictName.Items.Add(row[0].ToString() + ", " + row[1].ToString() + " " + row[2].ToString());
    }

What I need is to display the information in a textbox. Please help. Thanks.

  • 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-25T23:46:50+00:00Added an answer on May 25, 2026 at 11:46 pm

    Just Change the assign from your ComboBox to be your textBox

    txtBox1.Text = row[0].ToString() + ", " + row[1].ToString() + " " + row[2].ToString());
    

    You may take care of iteration, since just last row in this case will be shown in the textBox

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

Sidebar

Related Questions

I'm creating my first program in Visual Studio C++ 2008, coming from VB.NET -
when i am creating new android project from visual studio 2010 it gives the
I'm new to creating installers using Visual Studio, and was wondering about the Global
I am new to creating work item types in TFS and want to create
I am new in creating application using Visual Studio 2010 and Microsoft Access 2007.
I am trying to create an setup project in visual studio 2010 that clears
I am having trouble creating a new edmx file using Visual Studio 2011 beta
If I'm creating a new project in unmanaged C++, Visual Studio 2008 or greater,
I'm creating a new shorcut within and update of my program on the Start
I have problem creating new instance of excel 2007 using VBA (from Access 2002).

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.