DataSet one-to-one link relation of tables

max45

Member
Joined
Sep 19, 2007
Messages
7
Programming Experience
Beginner
Hi all,

In an access database I have a member table and a category table. The member table contains a categoryid field that relates to the categoryid field in the category table. I want to grab the categoryname field associated with the categoryid field from the category table and enter it into the member table. I want to do this because i want to display the resulting dataset in a datagridview control, and don't want the user seeing id fields, but rather the actual category. Ideally then I would like to make the category column in the datagridview control be able to have a dropdown menu on each cell where the user can change the category.

Is there any way of doing this?

Thanks in advance,

Max
 
Search the forums for cjard_does_datagridviewcombo.zip
The relation is not required
any db with a one-one relationship between tables should have the tables merged
 
hi cjard...
thanks for the reply! i'll check out your datagridview control.

regarding the relation, perhaps its another sort of relation. the member table has a categoryid field with an integer in it. This field relates to the primary key in the category table. Does this setup make it easier if a category name needs to be changed? because then all the rows in the member table don't need to be updated, but rather just the one row in the category table?

thanks.

max
 
hi cjard...
thanks for the reply! i'll check out your datagridview control.

regarding the relation, perhaps its another sort of relation. the member table has a categoryid field with an integer in it. This field relates to the primary key in the category table. Does this setup make it easier if a category name needs to be changed? because then all the rows in the member table don't need to be updated, but rather just the one row in the category table?

thanks.

max

Erm, its a relation in that the data within it is related to data in another table, but it isnt necessary for a DataRelation object to exist for this to work. If you see the example video of me using a microsoft control (i.e. not my control, just be tutoring how to use theirs) youll see that its very smple in concept.. We just bind the combo to a data list, tell it which column to show and which to use as the id value, and then also tell it which column of which table to write/read values to/from

A search of the forums for DisplayMember ValueMember should bring up many posts on the topic
 
hi cjard,

thanks again for your help..
i had a search for the video you mention but could only find posts where you make references to it. would you have the link handy?

thanks,

max
 
Back
Top