mcerk Posted August 24, 2005 Posted August 24, 2005 I have two tables in dataset: PhoneBill -phonenumber -cost -duration ..... and PhoneBook -phonenumber -surname_name All I want to do, is actually a RIGHT JOIN between tables on 'phonenumber field'. I Can Not Use SQL server or anything else, so let's try to do this on 'dataset level'. I want to join this tables. So in Datagrid I want to display: -phonenumber -surename_name (if exists in phonebook) -duration -cost .... 'I made a relation between tables in dataset ds.Relations.Add("PhoneBill_PhoneBook", ds.Tables("PhoneBill").Columns("phonenumber"), ds.Tables("phonebook").Columns("phonenumber"), False) 'the problem is, that I do not know how to display wanted data in one row: Me.DataGrid1.DataSource = ds.Tables("MainData") 'in this case there are displayed all records from phonebill, but there the column 'name_surname' is displayed lower as a child table. tx in advance :rolleyes: matej Quote
FZelle Posted August 26, 2005 Posted August 26, 2005 Just go to msdn.microsoft.com and search for joinview ;-) Quote
bri189a Posted August 27, 2005 Posted August 27, 2005 You won't find anything: A DataView is a sorted and/or filtered list of rows from 1 table only. Also, the Select method is on the DataTable and as such - can't look at other tables. (from http://objectsharp.com/Blogs/datasetfaq/) Follow the advice at that link. If that doesn't help let us know. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.