ASP.NET controls don’t let you specify a table index to use when binding a data source, so your query can really only return a single table if you’re using a SqlDataSource control to handle your data. The alternative would be to run the query from the codebehind and databind manually. Either method is fine with me really, but I’m curious what (and why) the “best practice” is in this situation.
Thanks
If you can get multiple sets of ‘needed’ data using one query, its always preferable PROVIDED you really need the data. Yout 2nd approach gives you that flexibility
Also, using a
SQLDataSource, in any real life production application would be against most best practices as it combines your DAL with your UI. There is absolutely no concept of layering when doing it in this manner and you are in effect making a 1 layer application.Dont use a
SQLDataSourcewould be my suggestion.