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

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

Postby Tatyana » Mon 08 Sep 2008 14:23

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
Last edited by Tatyana on Thu 24 Feb 2011 22:43, edited 1 time in total.
Tatyana
 
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Postby Tatyana » Tue 09 Sep 2008 13:49

:!: :?: I'm still interested in the answer and waiting for some comments.... :?: :!:

thank you.
________
How To Roll Blunts
Last edited by Tatyana on Thu 24 Feb 2011 22:44, edited 1 time in total.
Tatyana
 
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Postby Shalex » Tue 09 Sep 2008 14:41

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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Postby Tatyana » Wed 10 Sep 2008 08:47

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
Last edited by Tatyana on Thu 24 Feb 2011 22:44, edited 1 time in total.
Tatyana
 
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Postby Tatyana » Wed 10 Sep 2008 12:10

I also tried version 4.75. The same as in version 4.70.
________
Gift Cards
Last edited by Tatyana on Thu 24 Feb 2011 22:44, edited 1 time in total.
Tatyana
 
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Postby Shalex » Wed 10 Sep 2008 16:34

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.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Postby Tatyana » Thu 11 Sep 2008 08:22

Thank you a lot. It is clear now.
________
Extreme Vaporizer Review
Last edited by Tatyana on Thu 24 Feb 2011 22:44, edited 1 time in total.
Tatyana
 
Posts: 17
Joined: Mon 08 Sep 2008 14:01

Plane to implement

Postby degas » Wed 20 May 2009 19:25

Are you planning to implement this feature soon. I mean the ability to do this using the designer.

Keep the great work.
degas
 
Posts: 77
Joined: Mon 16 Feb 2009 18:36
Location: Argentina

Postby Shalex » Fri 22 May 2009 11:32

This is a limitation of DataGridView. We cannot overcome it.
Shalex
Devart Team
 
Posts: 7654
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle