P
Prasun
Hello:
I am trying to extract the unique rows from a child table. Currently I am
set the create contraints vaue in the datarelationship to False. Because of
this, it will ignore the unique values in the child table. I want to be able
to figure out how to know which rows are unique.
Here are the DataRelationships
Code:
RelProcCode = New DataRelation("ProcCodeTC", ParentCol, Child1Col, False)
XLFileMainDS.Relations.Add(RelProcCode)
RelProcCode1 = New DataRelation("ProcCode26", ParentCol,
Child2Col, False)
XLFileMainDS.Relations.Add(RelProcCode1)
Here is the code to access the child rows and do the necessary changes
Code:
For Each DataRowMain In XLFileMainDS.Tables("TableWithMain").Rows
For Each DataRowTC In DataRowMain.GetChildRows(RelProcCode)
DataRowMain("Tech Amt") = DataRowTC("Amt")
DataRowMain("Tech Allowed") = DataRowTC("Allowed
Amount")
Next
For Each DataRow26 In DataRowMain.GetChildRows(RelProcCode1)
DataRowMain("Prof Amt") = DataRow26("Amt")
DataRowMain("Prof Allowed") = DataRow26("Allowed
Amount")
Next
Next
Thank You
Prasun
I am trying to extract the unique rows from a child table. Currently I am
set the create contraints vaue in the datarelationship to False. Because of
this, it will ignore the unique values in the child table. I want to be able
to figure out how to know which rows are unique.
Here are the DataRelationships
Code:
RelProcCode = New DataRelation("ProcCodeTC", ParentCol, Child1Col, False)
XLFileMainDS.Relations.Add(RelProcCode)
RelProcCode1 = New DataRelation("ProcCode26", ParentCol,
Child2Col, False)
XLFileMainDS.Relations.Add(RelProcCode1)
Here is the code to access the child rows and do the necessary changes
Code:
For Each DataRowMain In XLFileMainDS.Tables("TableWithMain").Rows
For Each DataRowTC In DataRowMain.GetChildRows(RelProcCode)
DataRowMain("Tech Amt") = DataRowTC("Amt")
DataRowMain("Tech Allowed") = DataRowTC("Allowed
Amount")
Next
For Each DataRow26 In DataRowMain.GetChildRows(RelProcCode1)
DataRowMain("Prof Amt") = DataRow26("Amt")
DataRowMain("Prof Allowed") = DataRow26("Allowed
Amount")
Next
Next
Thank You
Prasun