Hi Robert,
Robert Bravery said:
HI Bart,
I see where you going with this, but surley the, in my case, worktime
should
be the parent, as it is the navigating table. I might have 5000 records in
worktime, but only 5 in billtype, which is the lookup. If I make lookup
the
parent int the relation,
then my primary navigation will only be 5 records.
You only want to show one table so who says the parent must be the
navigating table, no in your case the child table is the navigating table
and the parent table (lookup) is not shown, it's only used to lookup values.
No matter what I try with the table and column collection I can get this
right. All I want to do is show the billtype description in the grid
inplace
of the FK billid
I already suggested two options, let my clarify the second option (which
doesn't use a ComboBoxColumn).
Suppose there is a worktime table which has a foreign key column to the
billtype table which is the lookup, the billtype table has a description
column or something like that.
Add the billtype and worktime table to a typed DataSet (anyway you do it),
then open the DataSet schema designer and make sure there is a relation
between them as follows:
Name: billtype_worktime
Parent: billtype - bill_id (pk)
Child: worktime - bill_id (fk)
Now, once you have this relation, go to the worktime table (still inside
DataSet schema designer), add a column to it by typing into it, name the
column something like "BillType" and choose a string as datatype. Then open
the properties window (make sure the new column remains selected) and then
set the property Expression to "Parent(billtype_worktime).description"
(without the quotes).
(billtype_worktime= name relation and description= a field from billtype)
Save and compile.
Put an instance of this DataSet on a Form, make sure there are two correct
DataAdapter configured. Then place a DataGrid on the Form and configure as
follows:
DataGrid
DataSource = yourDataSetOnTheForm
DataMember = "worktime"
That's it, now you should see the worktime table (child) with an extra
column "BillType" which shows you the description field out of the billtype
table (parent).
In dBASE this is so simple, whether I cant get my mind around .net or
whether I am doing something completely wron I don't know, BUT I need help
But you can't really compare both, VS2005 can be used for a wide range of
applications, while it does have DB support (UI and otherwise) it's in many
cases harder to setup an UI then it is with a database application like
access or dbase.
HTH,
Greetings