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

C# Binding Listbox DisplayMember to Parent Table value

I am using VS 2003.
I have two tables, BookOrders and BookInfo. BookOrders holds order info which would contain a book Id. Book info will contain the details such as a books title. I want to bind a listbox to the BookOrders table but set the DisplayMember property to the BookTitle column in the BookInfo Table. This is what I've tried:

listbox.DataSource = dataset.BookOrders.Select("BookID = '12345'");
listbox.DisplayMember = dataset.BookOrders.ParentRelations["12345"].ParentTable.Columns["BookTitle"].ToString();

This does not work. I don't think I'm using ParentRelations correctly or even if this kind of binding is possible. Any suggestions would be helpful.
Jun 5 '07 #1
0 1323

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

Similar topics

1
by: Tomek Kmiecik | last post by:
Hello! I'm writing simple database application. One table in the database stores some information about keywords (among other, keyword name, id number and description). Description is stored in...
3
by: Scott | last post by:
I'm trying to bind my listbox to a SQL query like this: using (SqlConnection conn = new SqlConnection(CONN_STR)) { using (SqlDataAdapter da = new SqlDataAdapter("roboticSiteNames", conn)) {...
1
by: amber | last post by:
Hello I'm trying to run the code below, but I'm running into a problem It is populating a listbox, based on whether or not the user enters data into a text box. If they enter something, it returns...
8
by: Richard L Rosenheim | last post by:
I have a dataset containing a parent table related to a child table. The child table contains an ID field (which is configured as autonumber in the datatable), the ID of the parent, plus some...
1
by: Bruce | last post by:
Hi, there, I meet a problem about comboBox binding. -------------------- Database: Northwind Tables: 1) Products 2) Categories I create a form (named "form1") to edit the record from...
16
by: Michael C# | last post by:
I'm binding a Combobox to an Arraylist, and I'd like to set the ValueMember and DisplayMember properties of the Combobox. Is this possible, or do I need to bind to a DataTable? Thanks
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
1
by: A. Spiehler | last post by:
I'm trying to fill a listBox control with string members from an array of objects. I think using data binding is supposed to be the easiest way to do this. I've never used data binding before and...
1
by: Peter | last post by:
Hi, I'm trying to create a form that shows table rows in a listbox. Several comboboxes expand the foreign key fields into text values from the parent tables, and there are also some textboxes...
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
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
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...
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.