Frans,
I have two tables with 1-m relation (project-account), and want to update directly the dueDate fields in both tables.
I used the following code:
Dim adp As New DataAccessAdapter
Dim project As New ProjectEntity(ID)
Dim AccountCol As New EntityCollection
Dim Account As AccountEntity
Dim bucket As New RelationPredicateBucket
bucket = project.GetRelationInfoAccountCol
AccountCol = project.AccountCol
With project
.IsNew = False
.dueDate = dueDate
End With
For Each Account In AccountCol
Account.dueDate= dueDate
Next
Try
adp.UpdateEntitiesDirectly(project, bucket)
Catch ex As Exception
Debug.WriteLine(ex.Message)
Throw ex
Finally
adp.Dispose()
End Try
But get the following exception:
An exception was caught during the execution of an action query: The column prefix 'AccountProject.dbo.Account' does not match with a table name or alias name used in the query.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
The Stack Trace
StackTrace " at SD.LLBLGen.Pro.ORMSupportClasses.ActionQuery.Execute()
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.ExecuteActionQuery(IActionQuery queryToExecute)
at SD.LLBLGen.Pro.ORMSupportClasses.DataAccessAdapterBase.UpdateEntitiesDirectly(IEntity2 entityWithNewValues, IRelationPredicateBucket filterBucket)
at BLL.queryMan.SetFizetve(Int32 ID, DateTime elszamolasDate, DateTime fizetveDate, Boolean IsProject) in C:\VB7projectek\MunkaElszamolo\BLL\queryMan.vb:line 547" String
Thanks in advance
"The hardest task; to find the simplest solution"