Public Function createRelation(ByRef dataSetName As DataSet, _ ByVal tableMaster As String, ByVal tableChild As String, _ ByVal fldMaster As String, ByVal fldChild As String, _ ByVal relationName As String, ByVal creatConstr As Boolean) As DataRelation Dim ParentChild As DataRelation Dim parentColumn As DataColumn Dim childColumn As DataColumn parentColumn = dataSetName.Tables(tableMaster).Columns(fldMaster) childColumn = dataSetName.Tables(tableChild).Columns(fldChild) ParentChild = New DataRelation(relationName, parentColumn, childColumn, creatConstr) Return ParentChild End Function