Search code examples
.netstrongly-typed-dataset

Datasets. Why use the query adapter instead or table adapter?


Can someone tell me why I would use a query adapter within the dataset designer instead of adding queries to the table adapter?

Regards


Solution

  • Sometimes your queries do not need to be associated with an actual DataTable. Perhaps you have a Query that is logically grouped within your DataSet, but has no real backing store.

    For Instance, suppose you wanted to call a stored procedure that safely deletes all associated records for a given customer:

    proc_DeleteAllAssociatedCustomerRecords

    This really doesn't belong to any one particular entity as it might span multiple tables, but still belongs in your CustomerDataSet.