473,651 Members | 2,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying the textual value from a foreign table in a datagrid using the foreign key

I have a dataset that I bind to two different datagrids. The dataset
contains 2 tables. One is the main table used to store what I call
session data which includes a Country field where the ID of a country
is stored. The second table contains a list of countries. When adding
records to the dataset, I use a form that contains a datagrid and this
grid has a combobox that allows the user to select the country. The
combobox retrieves its display values from a Countries table. The
actual value stored is the ID associated with the country. This
actually works. After the record has been stored to the database, the
user can view the stored data with a different form. This form is used
only for reading. But when I display this readonly form, I do not want
to display a combobox in the Countries column. Instead, I simply want
to display the country's name in a normal textbox field.

I've been reading up on bindings and relations but I can't seem to
figure out how to get the datagrid to retrieve the display value from
the Countries table based on the ID and then display the textual name
of the country. Any ideas?

Thanks for your help
Johann Blake

Nov 17 '05 #1
0 1204

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

Similar topics

12
2444
by: Charles Astwood | last post by:
Hi, just starting out working my way round C Sharp and aspx. Used to write all my sites in asp and just need a few pointers in how to display data. I have made a connection to my SQL2000 database with SqlConnection as I think this is the fastest and best? I have also written my SELECT statement, but am confused in how to display this data not in a Table as all the examples on the web seem to want me to
3
2539
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called "Resource" with the following structure : Resource{,en,fr,es} Yes.. these are the only languages supported actually. A couple of rows in that table would look like this :
2
1219
by: Mervin Williams | last post by:
I just discovered that the datagrid does not display if the webform is in new mode. Let's say, for instance, that my datagrid is for contacts related to a company, so that companyid id a foreign key in the contact table. Well, if the contact does not yet exist, the datagrid will not display. I would like the datagrid to display the footer (which I've set up to insert new rows into the datagrid), although perhaps disabled. Is there a...
0
932
by: blackg | last post by:
I need help to display images from my table in a datagrid I have two tables that are join together. Product_Image and Product my select query is : SELECT Product_Image.ProductID,Product.Product,Product.Price,Product_Image.SMimgdata FROM Product_Image INNER JOIN Product ON Product_Image.ProductID = Product.ProductID
0
1509
by: latin & geek via DotNetMonster.com | last post by:
hi! ok, im working on a database application. ive successfully managed to establish a relationship between two tables and display them on a datagrid, edit and add new records to them. now i need to generate a report using the parameters in the child table, and two columns from the parent table. this is where the problem starts. when i use two seperate connection links and extract the required data, adding it all to the same dataset,...
2
8613
by: clickon | last post by:
I am using ASP.net 2.0 and trying to take advantage of the updated data editing facilities provided through the SQLDataSource control and the DetailsView control. The data is a record from a customer complaints table and one of the fields on the DetailsView control is called ComplaintType. The field is a template field and in insert mode and edit mode i have used a DropDownList control bound to a set of keys and values in a ComplaintTypes...
3
2214
by: Richard Carpenter | last post by:
I understand how to use a dropdown list control to display the associated description value for a foreign key in a parent rather than the key itself, but I don't like having to disable the control when I want to prevent editing (simply displaying in the display template of a datalist or detailview control, for example). I've not been able to find a way to edit the disabled color of the dropdown list, so it appears very washed out - just...
1
1390
by: sushant2009 | last post by:
Hi , I want to display empty databae table(actually table contains lot of records) to datagrid using dataset and dataadpter. After displaying i will fill new records in datagrid and i will save it in above thing i want to save new records using datagrid,dataset and dataadpter withought displaying previous ones Some one will tell me please how to do this
5
2455
by: Harlequin | last post by:
Hi there, I'm something of a newcomer to MS Access so it's more than likely that my question is extremely elementary. I have a form whose record source is a single table in my database. It's purpose is only to display in sequence,every record in this table. Trouble is, one particular field in this table (tblAttendees) is a foreign key in a foreign key - primary key relationship to a field in another table. The foreign key, is of datatype...
0
8277
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8465
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8581
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4285
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2701
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1910
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.