LLBLGen Pro version: 1.0.2005.1
.NET Framework 1.1 SP1, C#
SelfServicing, two class scenario
SQL Server Express 2005
Okay, I have a Subscription table which is related to Performance table via m:n relation using SubscriptionPerformance.
In a form, Subscription collection is bound to a listbox. There is a master detail view that shows some data from each Performance entity from currently selected Subscription.
If I want to edit Performance collection, I'm using a new form.
When I close that form i want to display refreshed data for currently selected Subscription.
subscription = (NetgenTheatron.EntityClasses.SubscriptionEntity) this.cmSubscriptions.Current;
subscription.AlwaysFetchPerformanceCollectionViaSubscriptionPerformance = true;
subscription.Refetch();
Then I go through every Performance entity in PerformanceCollectionViaSubscriptionPerformance and adding data to master detail view.
foreach(NetgenTheatron.EntityClasses.PerformanceEntity performance in subscription.PerformanceCollectionViaSubscriptionPerformance)
{
this.lblPerformanceList.Text += performance.Name + " (" + performance.Date + ")\n\n";
}
This works OK if I add Performance entities to the collection, but not when deleting from it.
When deleting, the master detail view remains the same, and when I try to open the form for editing Performance collection I get an exception saying "This entity is deleted from the database and can't be used in logic." It doesn't happen when I'm adding entities to Performance collection.
Any help? Thanks!