Last post Dec 20, 2010 03:02 PM by atconway
Dec 18, 2010 12:48 PM|chadwixk|LINK
I am trying to advance my ASP.NET architecture knowledge and have just read the
DAL Tutorial. It all seems pretty straight forward, but my first need that I have and want to implement is a criteria/results page that allows the user to select 1 or multiple criteria and then display the results below it in a gridview based on their criteria.
So how do you handle the myriad of combinations of parameters in a TableAdapter?
Thanks in Advance,
Dec 18, 2010 06:57 PM|chadwixk|LINK
I have found
this article, but it starts putting data access into the ASPX page, which seems to go against the whole reason for having a DAL, right? I'd rather see that in the ASPX form you populate certain parameters and pass those to the extended Fill method. Then
have IT dynamically generate the select command. Am I off base here?
Dec 20, 2010 03:02 PM|atconway|LINK
It all seems pretty straight forward, but my first need that I have and want to implement is a criteria/results page that allows the user to select 1 or multiple criteria and then display the results below it in a gridview based on their criteria. So how do
you handle the myriad of combinations of parameters in a TableAdapter?
Well that article is actually not bad as an introductory insight into a traditional 3-layer architecture. In fact many of the intro articles on UI-BLL-DAL use 'wizzadry' type components such as TableAdapters, StronglyTyped DataSets, ObjectDataSource, etc
rather than pure Business Objects and making all of the communication happen manually. It is not a bad way to start just to learn the concepts of layering, before moving to a more advanced approach.
Typically with a 1:n selection, you could build up an object of say List (Of Integer) that could then be passed along, processed to gather data, and then pass the resulting data back upstream to the UI either in the form of a more rudimentary object like
a DataSet to bind to the Gridview or Business Object once progressing to a more advanced version of layering. One of the things I don't like about certain uses of TableAdapters is when created and configured at the UI they can be far reaching to the database
thus consolidating layers and not adhering to separation of concerns.
If you have very specific use question on using TableAdapters, I would post them in the following forum:
DataSource Controls - SqlDataSource, ObjectDataSource, LinqDataSource: