473,408 Members | 2,441 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,408 software developers and data experts.

Combo Box in Grid using two related tables. Displaymember from T1 but ValueMember from T2

Two tables: Accounts and Companies

Accounts (AcctID, AcctNmbr, AcctName, CompID) -- AcctID is PK and
CompID is Foreign Key from Companies.
Companies (CompID, CompName) -- CompID is PK.

Created a DataSet AcctDS with two Data Tables, Acct and Comp

Created a grid and I want to show the following in the Grid:

AcctNmbr AcctName Company

where Company is a ComboBox, whose values will be derived from the
Companies table. I only want to show CompName in the combo box.
DisplayMember is CompName from Comp Data Table and ValueMember is
CompID from Acct Data Table. So, a user can pick CompName from the
drop down combo box, but the actual value will be stored as CompID in
the Accounts table.

Please reply
Nov 16 '05 #1
1 1191
Hi Gudia,

Because you send this to the language.csharp group and the language.VB group
will you tell us first in what relation you want to use it?

Because of this I get the idea that your question is not language related.

Cor
Nov 16 '05 #2

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

Similar topics

0
by: Dianna K | last post by:
I have a combo box which is set up as such: Me.cboGenre.DataSource = Ds.Tables("Genre") Me.cboGenre.ValueMember = "genre_id" Me.cboGenre.DisplayMember = "genre_description" The above loads...
10
by: Mike L | last post by:
This is for a Win form. Currently, the first record is shown in the combo box. I want the combo box to be blank and when the user clicks on the down arrow to choose from the list and clicks on...
1
by: Young J. Putt | last post by:
I have what I thought was a relatively simple data situation that I can't seem to get working using ADO.NET datasets and data binding. I have an "Issues" table which records the UserID of the user...
6
by: Brian Henry | last post by:
Here's an example of the code.. I have two combo boxes on screen that when one's selection is change the other's items will be updated to reflect the change (based on a relation) Private...
1
by: gudia | last post by:
Two tables: Accounts and Companies Accounts (AcctID, AcctNmbr, AcctName, CompID) -- AcctID is PK and CompID is Foreign Key from Companies. Companies (CompID, CompName) -- CompID is PK. ...
6
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns...
10
by: Richard | last post by:
I have created a form which sets up a dataview. The form views one record at a time using a currencymanager. This works fine. All my text boxes bind. However I have a combo box which gets its...
6
by: Jean Christophe Avard | last post by:
Hi! I'm designing an application that produces invoices. I have a combobox that is populated with the Name of every client in the database. What I would like to do is to have the combobox to...
9
by: Kay | last post by:
Hi all, Could you tell me the best way to add a blank item(as first item) in a data binded combo box? Because I think I didn't do it right and it generate an error if the second item(after the...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.