Hi, cant get my dataRelations to work. I have an n-tier app with an application layer calling a dataset from the lower levels:
Dim objRoutingMaster As New elantis_BUS.BusRoutingMaster()
Dim objWorkCentre As New elantis_BUS.BusWorkCentre()
Dim dsReturn As New DataSet()
Sub 1
dsReturn = objRoutingMaster.All
Sub 2
dsReturn = objWorkCentre.All
Data Acces Layer 1
myOleDbDataAdapter.Fill(dsReturn, "Routings")
Data Access Layer 2
myOleDbDataAdapter.Fill(dsReturn, "WorkCentre")
Back at the presentation tier
Dim WorkCentre As New DataRelation("WorkCentre", Me.dsReturn.Tables("Routings").Columns("WCID"), Me.dsReturn.Tables("WorkCentre").Columns("WCID"))
dsRoutingMaster.Relations.Add(WorkCentre)
I am getting an error stating that the object reference is not set. It seems to me as that when I call the dataadapter for the second time instead of adding another table to the dataset, it is overwriting the complete dataset.
What am I doing wrong ????
Dim objRoutingMaster As New elantis_BUS.BusRoutingMaster()
Dim objWorkCentre As New elantis_BUS.BusWorkCentre()
Dim dsReturn As New DataSet()
Sub 1
dsReturn = objRoutingMaster.All
Sub 2
dsReturn = objWorkCentre.All
Data Acces Layer 1
myOleDbDataAdapter.Fill(dsReturn, "Routings")
Data Access Layer 2
myOleDbDataAdapter.Fill(dsReturn, "WorkCentre")
Back at the presentation tier
Dim WorkCentre As New DataRelation("WorkCentre", Me.dsReturn.Tables("Routings").Columns("WCID"), Me.dsReturn.Tables("WorkCentre").Columns("WCID"))
dsRoutingMaster.Relations.Add(WorkCentre)
I am getting an error stating that the object reference is not set. It seems to me as that when I call the dataadapter for the second time instead of adding another table to the dataset, it is overwriting the complete dataset.
What am I doing wrong ????