thomas10001
Well-known member
I have two dataadapters
oleDbDataAdapterTournament and
oleDbDataAdapterGroup
// they have the wizard generated sql for table tournament respectively group. I have also a dataadapter
dsTournament1
which has the both tables (tournament and group). I also have connected a relation in the dataset (called tournamentgroup) to connect tournament.groupid to group.groupid
I have a listbox which shows the tournament.name and a textbox
which shows the correlated group for the tournament.
(connected to .text property as dsTournament1 - tournament.tournamentgroup.groupname)
Everything works fine in changing the master and the child shows the corresponding value.
But when I want to save .Update the data for the group table I doesnt save.
I have tried this code for saving
this.BindingContext[dsTournament1,"group"].EndCurrentEdit();
oleDbDataAdapterGroup.Update(dsTournament1,"group");
dsTournament1.AcceptChanges();
I dont know if its possible to save the child table but I assume it is. Is this that the correct way to address the group table to make it save or should the the relation object be used somehow in the bindingcontext and update method to make it work?
FYI the load event looks like this:
dsTournament1.Clear();
oleDbDataAdapterTournament.Fill(dsTournament1);
oleDbDataAdapterGroup.Fill(dsTournament1);
and save code (which works fine) for tournament table looks like this:
this.BindingContext [dsTournament1,"tournament"].EndCurrentEdit();
oleDbDataAdapterTournament.Update(dsTournament1);
dsTournament1.AcceptChanges();
Thanks!
oleDbDataAdapterTournament and
oleDbDataAdapterGroup
// they have the wizard generated sql for table tournament respectively group. I have also a dataadapter
dsTournament1
which has the both tables (tournament and group). I also have connected a relation in the dataset (called tournamentgroup) to connect tournament.groupid to group.groupid
I have a listbox which shows the tournament.name and a textbox
which shows the correlated group for the tournament.
(connected to .text property as dsTournament1 - tournament.tournamentgroup.groupname)
Everything works fine in changing the master and the child shows the corresponding value.
But when I want to save .Update the data for the group table I doesnt save.
I have tried this code for saving
this.BindingContext[dsTournament1,"group"].EndCurrentEdit();
oleDbDataAdapterGroup.Update(dsTournament1,"group");
dsTournament1.AcceptChanges();
I dont know if its possible to save the child table but I assume it is. Is this that the correct way to address the group table to make it save or should the the relation object be used somehow in the bindingcontext and update method to make it work?
FYI the load event looks like this:
dsTournament1.Clear();
oleDbDataAdapterTournament.Fill(dsTournament1);
oleDbDataAdapterGroup.Fill(dsTournament1);
and save code (which works fine) for tournament table looks like this:
this.BindingContext [dsTournament1,"tournament"].EndCurrentEdit();
oleDbDataAdapterTournament.Update(dsTournament1);
dsTournament1.AcceptChanges();
Thanks!