all groups > vb.net data > december 2004 >
You're in the

vb.net data

group:

I need to fill a combo box from one table, but bind to another


I need to fill a combo box from one table, but bind to another Larry Woods
12/28/2004 4:52:43 AM
vb.net data: This form is a "typical" data entry form where we might be collecting
Customer information.

I am trying to fill a combo box with a dataview that has (state,stateabbrev)
as 2-col. rows. The State name will be the DisplayMember and the State
abbreviation as the Value Member. But I want the displayed State to be tied
to a field in another dataset; i.e., the State abbrev. will be stored as a
field in another table. I want to bind the combo box to the field value
(the abbrev.).

Ideas?

TIA,

Larry Woods

RE: I need to fill a combo box from one table, but bind to another sstein NO[at]SPAM online.microsoft.com (
1/11/2005 8:11:17 PM

Hi Larry,

Bind the SelectedValue of the ComboBox to the column in your other table.
For example, if your tables are Customers, and States bind the
SelectedValue property to the State column in the Customers table.


hope that helps

Steve Stein
VB Team

This posting is provided "AS IS" with no warranties and confers no rights.

--------------------
| From: "Larry Woods" <larry@NOSPAMlwoods.com>
| Subject: I need to fill a combo box from one table, but bind to another
| Date: Tue, 28 Dec 2004 04:52:43 -0700
| Lines: 17
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
| Message-ID: <upSn1ON7EHA.4028@TK2MSFTNGP15.phx.gbl>
| Newsgroups: microsoft.public.dotnet.languages.vb.data
| NNTP-Posting-Host: ip68-225-198-107.ph.ph.cox.net 68.225.198.107
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15
.phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb.data:4590
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb.data
|
| This form is a "typical" data entry form where we might be collecting
| Customer information.
|
| I am trying to fill a combo box with a dataview that has
(state,stateabbrev)
| as 2-col. rows. The State name will be the DisplayMember and the State
| abbreviation as the Value Member. But I want the displayed State to be
tied
| to a field in another dataset; i.e., the State abbrev. will be stored as a
| field in another table. I want to bind the combo box to the field value
| (the abbrev.).
|
| Ideas?
|
| TIA,
|
| Larry Woods
|
|
|
AddThis Social Bookmark Button