Re: DataSet Question -- Simple Concept? Beginner to 3-Tier asp.net



I don't write anything for ASP apps, so my way of doing things may or may
not be appropriate. However, just because you have a strongly typed dataset
does not mean you cannot still create an app in a layered fashion. Realize
of course that the dataset is disconnected. If you create a data layer to
interact with your stored procedures, you can simply send tables of
information back and forth to that layer and let it do all the work. In
fact, I pull tables in the data layer and then merge them with the strongly
typed dataset. Where this whole idea gets blurred is via the
tableadapters -- well, Microsoft, which is it, disconnected datasets or
datasets with tableadapters that are now "disconnected" but most decidedly
part of the data layer? Needless to say, I do not use the table adapters, I
immediately delete those when using the dataset designer, but create the
params with the normal data adapters, then move the params back to the data
layer.

"Rangy" <davidwank@xxxxxxxxx> wrote in message
news:1164674888.691814.151380@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I am trying to be a thorough coder and create an app in layers. I can
do it using the sqldatasource but I really want to try creating the app
with tiers....thus....

If I use VS2005 to create a typed data set, I see that I can allow VS
to automatically generate INSERT, UPDATE, DELTE, statements for the
dataset.

1. Since the INSERT, etc. commands are directed at the database, why
would you want to write custom INSERT, etc,. commands for the dataset?
I though that that was the whole point of using stored procedures? If
I want to use Northwind and return all products that cost over $1, I'd
create a stored procedure ReturnProductsOverOneDollar. So if you use a
stored procedure, would you put it in the DAL, or as a buisness rule in
the business layer? Ideally I'd have a datlist or similar control, and
then call the ReturnProductsOverOneDollar sp to populate it.

2. I would then this example, want to allow the user to add a product
using another stored procedure, AddProducts. AddProducts would
obviously have an INSERT statement in it. Does this INSERT statement
have to be defined in the DAL? Clearly I have to code as many stored
procedures as I need, but does this mean that I have to write an
INSERT, UPDATE, and DELETE statement in the DAL for every possible
occurrence?

3. If I use northwind for example, and make a TableAdapter based on the
products table (call it ProductTableAdapter), I see that it generates a
Fill() method and a Get() method which returns data based on my SELECT
statement. If you let the Table Adapter Wizard automatically generate
the INSERT, UPDATE, etc. statements, why don't you see them as methods
in the TableAdapter.

Thank you so much in advance for your help.
-David



.



Relevant Pages

  • Re: DataSet Question -- Simple Concept? Beginner to 3-Tier asp.net
    ... I am trying to be a thorough coder and create an app in layers. ... If I use VS2005 to create a typed data set, I see that I can allow VS ... create a stored procedure ReturnProductsOverOneDollar. ... I'm using stored procedures in my Data Access Layer to write the info ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: OODesign - OPF, design pattern
    ... I wanted to put across that an app layer is ... if you hadn't used the framework in the first place. ... the plugins to be managed or unmanaged. ...
    (borland.public.delphi.non-technical)
  • Re: Data Limitations
    ... My database layer is getting a major upgrade due to .Net capabilities. ... App for HIPAA reporting and everyone needed the same data shown a different ... also needed to resuse this logic for a client side desktop app. ... making another trip to the db wasn't an option. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Just for kicks, try this
    ... Robbe Morris - 2004-2006 Microsoft MVP C# ... You may find that your stored procedure runs much, ... sql server 2005, another is using ado.net. ... increased about ~20 times from <1s to 20s in comparison with older app. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: OODesign - OPF, design pattern
    ... I developed a Pocket PC app last year using the compact framework. ... Maybe my design is just very simple then, ... and its in the application layer not the business ...
    (borland.public.delphi.non-technical)