By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,769 Members | 1,616 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,769 IT Pros & Developers. It's quick & easy.

DataView with more than one table

P: n/a
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

Jan 25 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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...
On 25 Jan., 10:04, "Christopher" <chrishunn...@gmail.comwrote:
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
Jan 25 '07 #2

P: n/a
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 ...
On 25 Jan., 04:22, "Uli" <ulrich.f...@gmail.comwrote:
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...

On 25 Jan., 10:04, "Christopher" <chrishunn...@gmail.comwrote:
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 adataview.
The problem I have is that I have data from one table and foreignkeys
to othertablesin 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- Zitierten Text ausblenden -- Zitierten Text anzeigen -
Jan 29 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.