Page 1 of 1

typed dataset: query-based master-detail does not work

Posted: Mon 08 Sep 2008 14:23
by Tatyana
Query-based Master-detail Relationship does NOT work for typed datasets.

I created typed dataset. I created an object of the typed dataset on the form. I set a master reference as described (http://www.devart.com/oranet/docs/DataTable.html). I created two grids for viewing master and detail tables.
Scrolling master table does not cause any changes in the detail table.

I tryed both Direct and notDirect connection.

I used trial version OraDirect .NET 4.70.38.0.

is it actually working? or may be I'm doing somethins wrong.
please, help....
________
ARIZONA MEDICAL MARIJUANA DISPENSARY

Posted: Tue 09 Sep 2008 13:49
by Tatyana
:!: :?: I'm still interested in the answer and waiting for some comments.... :?: :!:

thank you.
________
How To Roll Blunts

Posted: Tue 09 Sep 2008 14:41
by Shalex
If you have installed Oradirect .NET, please get acknowledged with our samples: Start menu | All programs | Devart OraDirect for .NET2 | Samples | WinForms | Run Compiled Samples. Take a look at MasterDetail sample. If you have any further questions, please let us know.

Posted: Wed 10 Sep 2008 08:47
by Tatyana
Thank you for the answer.

Yes, I've seen this example before and reviewed it again. It is NOT what I want. I do NOT want to fetch all data at once.

I want to fetch from the server only those records for the detail table which are connected to the selected master record. so the request to the server should be
"SELECT EMPNO,ENAME,JOB,MGR,HIREDATE,DEPTNO FROM Emp
where DEPTNO = :DEPTNO"

So I used this:
OracleConnection connection = new OracleConnection(connStr);
connection.Open();
OracleDataTable deptTable = new OracleDataTable("SELECT * FROM dept", connection);
OracleDataTable empTable = new OracleDataTable("SELECT * FROM emp", connection);
empTable.ParentRelation.ParentTable = deptTable;
empTable.ParentRelation.ParentColumnNames = new string[] { "deptno" };
empTable.ParentRelation.ChildColumnNames = new string[] { "deptno" };
deptTable.Owner = this;
empTable.Owner = this;
deptTable.Open();
empTable.Open();
deptDataGrid.DataSource = deptTable;
empDataGrid.DataSource = empTable;


But this example illustrates the work with oracle data tables. I want to use TYPED DATASETs.

So ones again. I create typed dataset. I create two tables in it. The select text is just like in the example. I created the object of this typed dataset on the form. Then in the design time in the Properties window I've set ParentRelation.ParentTable, ParentRelation.ParentColumnNames, ParentRelation.ChildColumnNames for the detail table. Detail table is inside the typed dataset. I also conected Master and Detail tables to the grids in order to see the results.
I run this test application. I scroll the master grid, detail grid is not updated, but it must. Each time I scroll master grid there should be a request to the server. something like "select * from detail table where parentID = :parentID" where parentID paremeter = ParentID selected in the master grid.

Hopefully now the question is clear.

I tried in ver 4.70.

with kind regards,
Tatyana
________
MARIJUANA MEDICAL

Posted: Wed 10 Sep 2008 12:10
by Tatyana
I also tried version 4.75. The same as in version 4.70.
________
Gift Cards

Posted: Wed 10 Sep 2008 16:34
by Shalex
When ParentRelation property is used to define a Master-Detail relationship, use the following settings for navigation in the Master table:

dataGridView1.DataSource = dataSet11.Master; // it can be set only in run time now, not in design time
dataGridView1.DataMember = null;

Because if you use:

dataGridView1.DataSource = dataSet11;
dataGridView1.DataMember ="Master";

it is referenced at another DataView, and its navigation is not tracked.

Posted: Thu 11 Sep 2008 08:22
by Tatyana
Thank you a lot. It is clear now.
________
Extreme Vaporizer Review

Plane to implement

Posted: Wed 20 May 2009 19:25
by degas
Are you planning to implement this feature soon. I mean the ability to do this using the designer.

Keep the great work.

Posted: Fri 22 May 2009 11:32
by Shalex
This is a limitation of DataGridView. We cannot overcome it.