Strongly Typed Dataset should be in DataAccess Layer or Business Layer

  • Thread starter Thread starter kittipong.kiatcheeranun
  • Start date Start date
K

kittipong.kiatcheeranun

I am not exactly sure that my understanding is right or wrong. In
strongly typed dataset we can generate all of the fields from tables
in database and also has tableadapter that allow us to write down sql
command in or directly link to table. We still can write the code in
dataset partial class for validating data as well.
As far as I understand strongly typed dataset is in both of Business
layer and data access layer, isn't it? Because validation rules code
and all datatable's fields should be in business layer and
tableadapter which is tied to sql command and connection string should
be in data access layer. Is this right or wrong? Any suggestion or
does it have any best way if I want to use strongly typed dataset in
my project.
 
Your assumptions are correct.
There are at least two alternatives:
- forget about datasets at all and go with ORM (object relational mapping).
There is a plenty of products out there (I am particulary keen to
LLBLGenPro)
- avoid using table adapters in the same assembly
- you could create them using a template based code generation approach
(i.e. CodeSmith)

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand

I am not exactly sure that my understanding is right or wrong. In
strongly typed dataset we can generate all of the fields from tables
in database and also has tableadapter that allow us to write down sql
command in or directly link to table. We still can write the code in
dataset partial class for validating data as well.
As far as I understand strongly typed dataset is in both of Business
layer and data access layer, isn't it? Because validation rules code
and all datatable's fields should be in business layer and
tableadapter which is tied to sql command and connection string should
be in data access layer. Is this right or wrong? Any suggestion or
does it have any best way if I want to use strongly typed dataset in
my project.
/
 
Back
Top