473,769 Members | 7,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1896
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, "Christophe r" <chrishunn...@g mail.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...@gm ail.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, "Christophe r" <chrishunn...@g mail.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
2100
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 DataView with 2 columns and 3 rows Dim ADOHelper As New DAL.ADOHelper Return ADOHelper.GetMyDataview() End
3
6430
by: Ruslan | last post by:
Hello, I have: BindingManagerBase bm;
2
3310
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 the selected lie item at which case I would pop up a separate dialog box to do so, in the debugging code, the dataview.count would return 0. I get a error message because I tried to get values out of a dataview that holds 0 items. Does anyone...
2
1498
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 file like. <product id = "105"> <Name>whatever</Name> <Categories> <Category name = "Category1"/>
20
5534
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 "clean up" the DataView once it is not referenced and will not effect the number of connections to the database. A DataReader on the other hand always maintains a connection to the database and must be explicitly closed (Do not rely on garbage...
11
27436
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 needs to be fast. Could I use a Dataview to filter for the value (which is unique) and return either the DataRow object so I can modify it and put it back into the DataSet the view is based on or somehow get the RowIndex in the DataSet that the...
7
1452
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). I want to walk through all the possible shows, checking if the person attended that show, by seeing if there is a record that contains that ShowID. For Each drAllShows In dvAllShows.Table.Rows filterString = "Show = '" &...
7
5628
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 with databinding. The data from the 2 detail tables are displayed in 2 datagridviews. I filter each datagridview with a Dataview object using the dataview.Rowfilter property. This is sort of working except that I am getting an except on one of my...
1
2587
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 update code for typical vb.net / asp.net data maintenance applications. For some reason they have two class files for each table, one is a collection class. Oddly both have the same properties for each table column duplicated.. a lot of duplicate...
3
5394
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 child based on values in both parent tables. When I edit the parent tables the edit is not reflected in the dataview.count property. How can I force the dataview to refresh following parent table edits? For example: Parent1
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.