Hello all,
Q1:In all asp.net books the authors would tell you to seperate your presentation , business, and data layer but why does the wizards for the sql data source combine the presentation layer with the data layer?
Q2:Is there a way to retreive a dataset after you execut the sqldatasource.insert() command? ......I have a store procedure(sp) that i am using for inserting records. The sp is where i 'm validating all my data (shop standard) for example, ssn length, last name <> 0 etc. If there are any errors i grab all the error code from another table and return it. I can't seem to figure out how to get the dataset...
Q1: Separating the 3 tiers is just the basic rule to keep things simple. In an Enterprise application, each tier will be split in sub tiers, ending in douzans of tiers. In the same way, in a small web app (which is what the wizards are for, not large scale enterprise stuff, not even medium), you still separate everything, but in a much smaller scale:
Dataset: Data layer. Datasource and code behind -> logic. ASPX file -> presentation.
Thats only valid for very small scale things though. A better way is to put your logic and data layer elsewhere, and wrap them in an object datasource. Then you can still use the wizards, while separating stuff for real.
Q2: Yeah its possible, but I'd suggest looking at the Object Datasource. For more complicated logic, it is much better to make a class with your 4 methods that handle all the ADO.NET in code, and then use an object datasource to bind it to your grids, dataviews, etc.
|||thanks for the info|||
cheetoz:
Q1:In all asp.net books the authors would tell you to seperate your presentation , business, and data layer but why does the wizards for the sql data source combine the presentation layer with the data layer?
I had the same experience, but then I found this:
http://www.asp.net/learn/dataaccess/default.aspx?tabid=63
No comments:
Post a Comment