Information générale
Catégorie:
The Mere Mortals .NET Framework
Mat,
"Doesn't this get back to the original problem of updating multiple tables with a single dataset?"
No, because I don't save that dataset(actually it is just a datatable).
If data comes from 3 tables, I make 3 queries where each query only selects fields from one table each, and databind the textboxes to these datasets.
To display data from all these 3 datasets in the grid, I create a datatable and populate it with the fields I want to show in the grid(using the LoadDataRow-method), and then databind the grid to the datatable.
When the user changes something in a textbox, I update the datatable the grid is bound to. When the user changes something in the grid, I update the datasets the textboxes are bound to(not by saving, but just by copying the data from the datatable to the datasets).
This way I get the read-write grid that I wanted, and I don't have to make an extra SQL-JOIN query and pull data from the database twice.
Kind Regards,
Christian
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement