P
pmz
Dear Group,
I’m retrieving data from a remote MySQL database server via MySQL .NET
Connector to a set of tables placed in one DataSet object. That works
fine.
The display of typical DataTable works perfectly, but problems occur
while I’m trying to create DataRelations in parent table with two
child tables. My parent table looks like the following sample:
[ID][ChildTable_ID][ChildTable2_ID][ParentTable_field1]
[ParentTable_field2][…]
My DataRelations are quite simple:
Parent table field named as ChildTable_ID is related with the ID field
from ChildTable. Obviously the parent table field ChildTable2_ID is
related with the ID field from ChildTable2.
My DataRelations are the following (which I've created):
DataRelation^ dr_1 = gcnew DataRelation(“my_relation_id1”, my_dataset-
DataRelation^ dr_2 = gcnew DataRelation(“my_relation_id2”, my_dataset-
Then I add them to DataSet object and that works fine.
Till now is perfect. I’m displaying DataSet-DataTable “parent_table”
in a DataGridView, with a .. problem. The only way to set a DataMember
in DataGridView is singular DataMember – in fact, even when I select
“my_ralation_id1” as a DataMember, fields from “parent_table” normally
shown, are missing – why?
Is there any simple solution for displaying data in a DataGridView,
populated from dataset table including relations – to be viewed as
additional columns in DGV?
Thank you very much for help.
All the best,
Przemek M. Zawada
I’m retrieving data from a remote MySQL database server via MySQL .NET
Connector to a set of tables placed in one DataSet object. That works
fine.
The display of typical DataTable works perfectly, but problems occur
while I’m trying to create DataRelations in parent table with two
child tables. My parent table looks like the following sample:
[ID][ChildTable_ID][ChildTable2_ID][ParentTable_field1]
[ParentTable_field2][…]
My DataRelations are quite simple:
Parent table field named as ChildTable_ID is related with the ID field
from ChildTable. Obviously the parent table field ChildTable2_ID is
related with the ID field from ChildTable2.
My DataRelations are the following (which I've created):
DataRelation^ dr_1 = gcnew DataRelation(“my_relation_id1”, my_dataset-
[“ChildTable”]->Column[“ID”]);Tables[“parent_table”]->Column[“ChildTable_ID”], my_dataset->Tables
DataRelation^ dr_2 = gcnew DataRelation(“my_relation_id2”, my_dataset-
[“ChildTable2”]->Column[“ID”]);Tables[“parent_table”]->Column[“ChildTable2_ID”], my_dataset->Tables
Then I add them to DataSet object and that works fine.
Till now is perfect. I’m displaying DataSet-DataTable “parent_table”
in a DataGridView, with a .. problem. The only way to set a DataMember
in DataGridView is singular DataMember – in fact, even when I select
“my_ralation_id1” as a DataMember, fields from “parent_table” normally
shown, are missing – why?
Is there any simple solution for displaying data in a DataGridView,
populated from dataset table including relations – to be viewed as
additional columns in DGV?
Thank you very much for help.
All the best,
Przemek M. Zawada