473,386 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Bind DataSet to ComboBox

24
I have a dataset with one table, which has a column "Description" in it. the dataset is populated with data.

i want to bind the dataset to the combo. i'm doing it as follows:

cb.DataSource=myDataSet.Tables[0];
cb.DisplayMember = "Description";
cb.ValueMember = "Description";

Problem is my Combobox remains with 0 items instead of the 80 rows in the datasource!!!

ANY ideas? thanks!!!
Aug 30 '07 #1
1 1637
dip_developer
648 Expert 512MB
I have a dataset with one table, which has a column "Description" in it. the dataset is populated with data.

i want to bind the dataset to the combo. i'm doing it as follows:

cb.DataSource=myDataSet.Tables[0];
cb.DisplayMember = "Description";
cb.ValueMember = "Description";

Problem is my Combobox remains with 0 items instead of the 80 rows in the datasource!!!

ANY ideas? thanks!!!
why are u setting same display and value member????
try setting different display member and value member..
Aug 30 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Omar | last post by:
When I try to databind my comboBox (specifically field "emplcode") to a filled dataset , the contents of the comboBox displays a bunch of "System.Data.DataRowView". I assume the amount of times...
7
by: Dan | last post by:
Very newbie question here: Any suggestions on how to bind an XML file to a combobox and datagrid? I've had no problem reading the data in a datagrid. But the combobox is another story. I...
6
by: Alpha | last post by:
I have a listbox with datasource from a dataview. When a user selects a different item in a combobox then I need to refresh the listbox to the appropriate listing based on that combobox's selected...
2
by: Ken Powers | last post by:
Hello everyone, I'm getting a strange error when I try to bind a combo box to a Dataset. Here's my code! Private Sub Get_Data() Try Dim sqlcmd = New SqlCommand("Select * from Utility order...
0
by: Ken Powers | last post by:
Hello everyone, Sorry about the repost, my second VB.NET App is done with the exception of this error. I'm getting a strange error when I try to bind a combo box to a Dataset. Here's my code! ...
1
by: dbuchanan | last post by:
Hello, I have the controls on my form display the values of the currently selected row of the dataGrid. There are a few fields that I have in my data table where I have the user select a value...
4
by: Steve | last post by:
C# I have some combo boxes, full of lookup descriptions. When I retrieve a dataset for my record, the values that need binding to the combos are the actual record IDs that relate to these...
11
by: guy | last post by:
I am able to use the Server Explorer to create a dataset containing tables in my database. I am able to bind a table to my combobox and set a filter by including a where clause. But I am unable to...
2
by: =?Utf-8?B?SmFtZXMgTWFydGlu?= | last post by:
I have a table that I dragged onto a form from a dataset. I changed some of the fields to comboboxes and set the data source, display member (text), and value member (int) to another table within...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.