Search code examples
asp.netsqldatasourceentitydatasource

ASP.NET Declarative Data Sources. Are they ever used if more than one table is involved?


For typical examples I see of SqlDataSource, LinqDataSource...

EVERY example deal with how to make changes to a Customer table where the Gridview/RADgrid directly represents the customer..

But in my case I have stored procedure which show data from multiple tables and make changes to multiple tables so it seems I am not a candidate for uses declarative data sources?

Or can anyone point me to an example?


Solution

  • Why not? If you can define single data object which will be used as result from GetCustomer procedure and input to StoreCustomer procedure you can wrap calling these procedures into some class and use ObjectDataSource. Your ASP.NET application doesn't have to know nothing about internal storing of Customer in database. The only requirement is to have flat object = no 1:N or M:N related data.