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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:54:42+00:00 2026-06-01T05:54:42+00:00

I have created a dataset in my visual studio project which is connected to

  • 0

I have created a dataset in my visual studio project which is connected to a Microsoft Acess datebase. I want to populate the values of a particular column in the table into the items of a combo box (i.e. dropdown box). For this I created a table adapter called “empnames” and a method “GetDataByName()” which selects only the column which is required.

First I tried this

comboBox1.ItemsSource = empnames.GetDataByName().ToString();

For this I get the letters in the table name as different items of the combo box. For example if the table name is emp_data, I get 8 items in combobox i.e. ‘e’,’m’,’p’,’d’,’a’,’t’,’a’.
Can you please help me to get proper result.

Thanks

Code:

private void Window_Loaded(object sender, RoutedEventArgs e) { 
SampleDataSetTableAdapters.Emp_dataTableAdapter empnames = new SampleDataSetTableAdapters.Emp_dataTableAdapter();
comboBox1.ItemsSource = empnames.GetDataByName();
} 

This is the code for method to populate the combobox items. The GetDataByName() is designed using table adapter query configuration wizard. Return type is data table.

  • 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-06-01T05:54:43+00:00Added an answer on June 1, 2026 at 5:54 am

    You should assign the DataTable to the ItemsSource, and set DisplayMemberPath to the name of the column you want to show.

    comboBox1.ItemsSource = empnames.GetDataByName();
    comboBox1.DisplayMemberPath = "Name"; // assuming there is a "Name" column
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this dataset created in Visual Studio 2008 in my project. I have
I have created a dataset in a project in visual studio that points to
i have created a simple public ref class in the vc++ project, which is
I have a c# Visual Studio app. I connected to an existing SQL Server
I have created a project with a simple RDLC report in ASP.NET which when
We have created a custom dataset and populating it with some data. Before adding
I have a strongly typed DataTable created with the VS2005/VS2008 DataSet designer. The table
I have a DataSet that I have added to my project where I can
I have created a strongly typed dataset in the VS 2005 Dataset Designer. There
I am new in creating application in Visual Studio 2010. I recently created an

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.