DataView with more than one table

C

Christopher

Hi,

I am writing a database application and now I need to display some data
and I have a question about it. The data is stored in a typed dataset.

In my MainForm I have a datagridview. the datasource of this datagrid
is a dataview.
The problem I have is that I have data from one table and foreignkeys
to other tables in the database.
When I create my view I would like to view the data from the second
table.
For example:
i have a table called movies in this movie table there is a "link" to
an actors table. when i create a view for the movies table i would like
to present the data of the actors table, i.e. the name of the actors.
at the moment i only have the id of the actor and not the name or some
other column.

I hope you have understood my problem and furthermore I hope you can
give me a clue how to solve this problem.

greetings
christopher
 
U

Uli

I have the same problem. I worked around by creating a "VIEW" in the
database an binding the datagrid to that view. thats good enough for
showing the data, but manupulating or adding a new row is not possible
that way.

the sql statement for making the VIEW is something like

SELECT table1.*, table2.*
FROM table1 LEFT OUTER JOIN
table2 ON table1.FK2 = table2.PK
table3 ON table1.FK3 = table3.PK

BUT if anybody knows a better way: Let us know...
 
C

Christopher

my problem is that the data that i want to "join" doesn't exist in the
database, it is only existent in the dataset (until I update and
propagate the changes).
the table i want to display has 3 or more foreign keys in it and as i
already mentioned i don't want to read ids i want to read data from
the other table.

i guess i could create a view in the dataset during runtime but that
would make my normalization unneccessary ...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top