473,395 Members | 1,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

DataView with more than one table

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
2 1887
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Raymond Lewallen | last post by:
I have a dataview in which the sort property will not sort the dataview. Here's is a simple scenario similar to what I am doing: Class Foo Private Function Retrieve() As DataView ' Returns a...
3
by: Ruslan | last post by:
Hello, I have: BindingManagerBase bm;
2
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit...
2
by: Guoqi Zheng | last post by:
Dear sir, New to ASP.NET, help will be appreciated. I need to create a XML file for product feed. In our business, one product always belongs to more than 1 categories. I need to have a XML...
20
by: Mark | last post by:
Hi all, quick question , a DataView is memory resident "view" of data in a data table therefore once populated you can close the connection to the database. Garbage collection can then be used to...
11
by: Tim Frawley | last post by:
I need to return a DataRow or the Row Index in a DataSet wherein the value I am attempting to find is not a primary key. I have to do this often, more than 200 times when importing a file so it...
7
by: Bernie Hunt | last post by:
I'm having trouble getting rowfiltering to work on my dataview. I have two dataviews, one with a list of shows (dvAllShows) and the other with a list of shows attended by a person(dvAttendedShows)....
7
by: Rich | last post by:
Hello, I am pulling master data from one master table and detail data from two detail tables. The rows from the master data are displayed in textboxes on my form which are bound to the data...
1
by: jc | last post by:
RE: Why use a CollectionBase class here vs dataset or dataview? I'm looking at some vb.net 2005 code that was generated from a homegrown Codesmith Template that generate all of the retreival and...
3
by: =?Utf-8?B?cG1jZ3VpcmU=?= | last post by:
I have a dataset with 3 tables -- 2 Parent tables and 1 table that is a child table of both the parents. I create a dataview on the child table and set the rowfilter to a value which filters the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.