On this page
Establishes query-based master-detail relation.
Syntax
|
|---|
'Declaration
Public Class ParentDataRelation |
|
|---|
public class ParentDataRelation |
Example
The following example shows how to render related data in two grids.
|
|---|
OracleConnection connection = new OracleConnection(
"User Id=Scott;Password=tiger;Data Source=Ora;");
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.FetchAll = true;
empTable.FetchAll = true;
deptTable.Open();
empTable.Open();
deptDataGrid.DataSource = deptTable;
empDataGrid.DataSource = empTable; |
|
|---|
Dim connection As New OracleConnection( _
"User Id=Scott;Password=tiger;Data Source=Ora;")
connection.Open()
Dim deptTable As New OracleDataTable("SELECT * FROM dept", connection)
Dim empTable As New OracleDataTable("SELECT * FROM emp", connection)
empTable.ParentRelation.ParentTable = deptTable
empTable.ParentRelation.ParentColumnNames = New String() {"deptno"}
empTable.ParentRelation.ChildColumnNames = New String() {"deptno"}
deptTable.Owner = Me
empTable.Owner = Me
deptTable.FetchAll = True
empTable.FetchAll = True
deptTable.Open()
empTable.Open()
deptDataGrid.DataSource = deptTable
empDataGrid.DataSource = empTable |
Inheritance Hierarchy
System.Object
Devart.Common.ParentDataRelation
See Also