473,387 Members | 1,757 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,387 software developers and data experts.

Assign ado.net dataset to combobox?

I have an app that I have been using this code to fill a datagrid:

DataSet ds = new DataSet("Recordset");
OleDbDataAdapter da = new OleDbDataAdapter();

// Call data adapter's Fill method to fill data from ADO
// Recordset to ADO.NET dataset
da.Fill(ds, rs, "tblTravelEventType");

// Assign data set to grid control
DropDownList1.DataSource = ds;
DropDownList1.DataMember = "tblTravelEventType";

But now I want to assign just one of the fields to the combobox1..
How can I do that? Can you give me an example?

Thanks,
Trint

Nov 17 '05 #1
2 2091
Trint,

The displaymember holds the datatable column in the box
The valuemember the column from the datatable that you want to use.

I hope this helps,

Cor
Nov 17 '05 #2
Cor,
Thanks...I don't know if you remember, but you helped me a couple of
years ago on a vb.net project question or two (maybe three).
Trint

.Net programmer
tr***********@gmail.com

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Marty | last post by:
Hi, Ok I use the OLEDBConnector and dataset to retrieve data from my Access DB. I have a problem to read/parse the dataset and I would like to know if I am using the right object to reach my...
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...
6
by: Johann Blake | last post by:
I fill a table in a dataset with values that will be used by a combobox for the combobox's items. The combobox is a drop down list that only allows the user to select from the list but not enter...
2
by: Simon Verona | last post by:
I have a combobox that is contained within a user control. Whilst the application is running, I'm attaching the combobox to a new dataset. The problem I'm getting is that the combobox doesn't...
2
by: Phil | last post by:
I need to created a typed dataset for a xml flat file and bind that dataset to a combobox. I was able to do this in VS.Net 2003 easy enough, but can't get it to work in VS.Net 2005. I've come...
5
by: Anil Gupte | last post by:
I am trying to use a dataset to assign a display name (one column from a table) and also associate a value (2nd column) to each item in a dropdown combobox. I tried it this way: ...
5
by: Hetal | last post by:
Hi there.. I am a VB6 developer so kinda trying to figure how to work with VB.NET. I have a scenario where i have a DataSet bound to a combo box, and i would like to read a row from the DataSet...
4
by: hhak | last post by:
Hi all, Im pretty new to C#, im trying to assign a combobox selected value to a int variable. int number; combobox has items added (1,2,3,4,...9) when i select a number from the combobox i...
4
by: cwilliams01 | last post by:
Hello I am new to VB.NET, so sorry if this is really obvious. I have written the following code to fill my dataset from a stored procedure requiring 1 paramter input (from a SQL database). The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.